Closed
Description
openedon Apr 3, 2018
Version
Reproduction link
https://nuxt-auth.herokuapp.com/
Steps to reproduce
- Login using "local" scheme.
- Check localstorage and cookies and you see the token with the prefix Bearer.
- Try to do a request with axios.
- The Authorization header will have 2 prefix and the token, ex: Bearer Bearer ........
- The request will fail beacause the authorization header is invalid.
What is expected ?
The token must be saved without the prefix because the setToken helper of axios module already set the prefix.
What is actually happening?
The token is saved with the prefix and all future request made by axios has an invalid authorization header.
- The fetchUser method of the module has the correct authorization header because builds it own header, because of this the login process is okey, you can see this in /lib/auth/auth.js file line 251.
Additional comments?
You can see this issue in the demo site, check the localstorage "auth._token.local" key after login and "auth._token.local" cookie:
https://nuxt-auth.herokuapp.com/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment