I am facing strange issue this package has its local strategy does not respond the way it should,this plugin keeps redirecting me to login route even if i was logged i just closed the browser and reopened it again and hit the home url but i was redirected to login route for unknown reason.Also on login the redirect stays on login no matter what url i add up for home here is my local strategy
auth: {
strategies: {
local: {
endpoints: {
login: { url: 'users/signin', method: 'post', propertyName: 'user.token' },
user: { url: 'users/me', method: 'get', propertyName: 'data' },
logout: false
},
tokenRequired: true,
tokenType: 'Bearer'
}
},
redirect: {
login: '/login',
logout: '/login',
callback:'/',
home: '/profiles',
},
rewriteRedirects: true,
watchLoggedIn: true
}
Any help regarding this issue will be really appreciated.
This issue as been imported as question since it does not respect auth-module issue template. Only bug reports and feature requests stays open to reduce maintainers workload.
If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically.
Your question is available at https://cmty.app/nuxt/auth-module/issues/c292.
I'm having the same issue but when I refresh the current page after my user log in, have you solved it? :/
I'm facing the same issue, disable the user end point by setting it to false solve the problem but i need that endpoint sadly :(
I have the same issue. Anyone found a solution?
Are we doing something wrong? Doesn't anyone else have this problem?
Having this problem too!
This happened in universal mode. This is what I found out, correct me if I am wrong. When the browser restart, the session cookie got discarded so the SSR won't have the token to authenticate. Because firefox would restore the cookie this won't happen to firefox.
About the redirect after login, when you load the page the auth module would extract the token from local storage. Because the token is still there, the auth module would set loggedIn state in the vuex store to true. So it might not trigger redirect after logged in. The default login method calls a reset method so it would always redirect. If you disabled the login endpoint like this:
auth: {
strategies: {
local: {
endpoints: {
login: false,
},
},
},
}
And use this.$auth.login() to redirect after your custom login logic. Be sure to call this.$auth.reset() first
Most helpful comment
I'm having the same issue but when I refresh the current page after my user log in, have you solved it? :/