-
Notifications
You must be signed in to change notification settings - Fork 926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Token is stored with prefix in cookie and localstorage #113
Comments
@javialon26 Hi ! Thank you for your bug report, confirmed as a bug on the demo site using the following command while logged in: $nuxt.$axios.get('api/auth/user'); This will automatically returns the following:
As the request headers are composed by an invalid Authorization header:
This is most likely related to this, I think the token is passed with "Bearer " and then set again with axios-module with "Bearer" is set by this on setToken (strategy, token) {
const _key = this.options.token.prefix + strategy
return this.$storage.setUniversal(_key, token)
} |
Fixed on #115 - Will be available soon 👍 |
Wait for updates。。。。How I delete the prefix |
Version
v4.0.0
Reproduction link
https://nuxt-auth.herokuapp.com/
Steps to reproduce
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.
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/
The text was updated successfully, but these errors were encountered: