-
-
Notifications
You must be signed in to change notification settings - Fork 185
Open
Labels
Description
Environment
Reproduction
Describe the bug
We have in my project globalAppMiddleware: true
If we set to true, in logs
[Vue Router warn]: Detected a possibly infinite redirection in a navigation guard when going from "/" to "/". Aborting to avoid a Stack Overflow.
Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.
If we remove it, error disappears
My nuxt.config.ts
auth: {
isEnabled: true, //all environment variables are strings
baseURL: `${process.env.NUXT_BASE_URL}/api/auth`,
globalAppMiddleware: true, pages: { signIn: '/login' },
provider: { type: 'authjs' },
sessionRefresh: {
enablePeriodically: 86400000, //refresh the session every day
enableOnWindowFocus: true,
},
},
Additional context
No response