So my problem is: I Have Lumen server on subdomain api.domain.com After sending ajax request from domain.com to api.domain.com:
$.ajax({
url: 'https://api.domain.com/login',
type: 'post',
headers: {
'Authorization': 'someJWTTOKEN'
'Content-Type': 'application/json'
},
data: {},
dataType: 'json',
success: function(result) {
console.log('result');
console.log(result);
},
error: function(error) {
console.log(error);
}
});
But when I remove Header from ajax request, everything works fine.
This works great:
$.ajax({
url: 'https://api.domain.com/login',
type: 'post',
headers: {
},
data: {},
dataType: 'json',
success: function(result) {
console.log('result');
console.log(result);
},
error: function(error) {
console.log(error);
}
});