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
this.$auth.loggedIn is always FALSE #999
Comments
Hi @jbiddulph! Can you show me the login response and the user response? |
Login
User:
|
It's pretty hard to debug slowly and via an Issue discussion. Can you please do some debugging to figure out why it's not set? Here's a place to start: https://github.com/nuxt-community/auth-module/blob/dev/src/core/auth.ts#L301 |
I don't have auth.ts file and I'm not using state?! |
@jbiddulph I think the problem is misconfiguration when migrating from v4 to v5. I updated your config, let me know if it worked :) auth: {
strategies: {
local: {
token: {
property: 'token',
required: true,
type: 'Bearer'
},
user: {
property: false, // here should be `false`, as you defined in user endpoint `propertyName`
autoFetch: true
},
// `propertyName` in endpoint was depreacted
endpoints: {
login: { url: 'auth/login', method: 'post' },
logout: { url: 'logout', method: 'get' },
user: { url: 'auth/profile', method: 'get' },
}
}
}
}, |
That's amazing, thank you so much! |
I'm happy to know it worked! :) |
I had a more complex issue, and have success fixing that with the next steps:
|
Breaking change indeed ... |
I'm having a duplicate of #999. The difference is that I'm using a cookie based authentication. auth: { axios: { |
my this.$auth.loggedIn is always FALSE, please help!!!
I am logging in, getting a valid jwt token and getting user details back in the response!
here is my NUXT auth version:
"@nuxtjs/auth-next": "^5.0.0-1610115973.9fdaa66",
and here is my nuxt.config.js
The text was updated successfully, but these errors were encountered: