This is the Token that we get after login using AngularJS from Laravel. "key":"c1bd8b7d26f1af5451e211c3ddfcb376f09add43"
[{"id":101,"user_id":7,"key":"c1bd8b7d26f1af5451e211c3ddfcb376f09add43","level":1}]
How we should pass this token throughout the Project for all the Request that we hit the Server either via POST and GET Methods.And how can we validate this token.
We are facing an Error when passing the obtained token by this method.
Our Code:
$http({
method : 'POST',
url : 'http://ift.tt/1PRuayG',
data : $scope.cartItem, //forms user object
headers : {
'Content-Type':'application/json',
'X-Authorization': 'c1bd8b7d26f1af5451e211c3ddfcb376f09add43'
}
})
We are not getting Syntax Error.In Laravel we have configured CORS Middleware also. Still we face this Error.
(Reason: missing token 'x-authorization' in CORS header 'Access-Control-Allow-Headers' from CORS preflight channel).
Provide us with a solution to rectify this.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire