Reputation: 153
I'm trying to save the token that my server sends on every request. Although apparently "Authorization" is present in the response, I can not print the value.
What I can print to the console:
On the server I'm using a middleware for cors:
How can I get the token that is coming from Header Authorization?
Upvotes: 0
Views: 255
Reputation: 8632
it looks that you did not expose the header correctly, the browser will not forward this header to your code unless you specify it.
try adding this to you $headers
object
'Access-Control-Expose-Headers' => 'Authorization'
Upvotes: 1