Whenever i try to login this auth module won't redirect me to home /.However on logout it keeps redirects me to logout which is ok but when i refresh the home page it keeps allowing me to visit it even if i am not logged in which seems like a pretty serious bug.I am using auth middleware to protect it but still no luck!
Here is my auth object
auth: {
strategies: {
local: {
endpoints: {
login: { url: 'users/signin', method: 'post', propertyName: 'user.token' },
user: { url: 'users/me', method: 'get', propertyName: 'data' },
logout: false
}
}
},
redirect: {
// login: '/',
logout: '/login',
home: '/',
callback: '/'
},
watchLoggedIn: true,
rewriteRedirects: true
}
Any help regarding this issue would 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/c259.
Hey, don't know if you found a solution but you need to add the following to your nuxt.config.js file
router: {
middleware: [
'auth',
]
},
Most helpful comment
Hey, don't know if you found a solution but you need to add the following to your nuxt.config.js file
https://auth.nuxtjs.org/guide/middleware.html