Recently, I encountered an issue while trying to set up a login service for my app. Here is the code snippet using $http:
$http({
method:"get",
url: ## BLAH BLAH BLAH,
headers: {
'Authorization': 'Basic ' + $base64.encode(loginData.username + ':' + loginData.password)
}
}).then(function success(response){
## BLAH BLAH BLAH
}, function error(response){
## BLAH BLAH BLAH
});
Upon running this $http request, I received an error on the console:
XMLHttpRequest cannot load ## BLAH BLAH BLAH.
Request header field Authorization is not allowed by Access-Control-Allow-Headers in preflight response.
I am confused about what could be causing this issue. Any insights or suggestions would be greatly appreciated. Thank you, Lucas.