The users are redirected to / after logging in.
I'm sure this is a correct behavior because I've checked this documentation.
However, Nuxt's middleware seems to be unable to properly handle this page redirection.
In a scenario where a user is redirected to /callback upon login and then subsequently to /, both the 'to' and 'from' parameters within the middleware are incorrectly set to /callback.
The 'to' should be /.
This leads to a catastrophic situation where many logics using middleware cannot be implemented.
Checklist
Description
The users are redirected to
/
after logging in. I'm sure this is a correct behavior because I've checked this documentation.However, Nuxt's middleware seems to be unable to properly handle this page redirection.
In a scenario where a user is redirected to
/callback
upon login and then subsequently to/
, both the 'to' and 'from' parameters within the middleware are incorrectly set to/callback
.The 'to' should be
/
.This leads to a catastrophic situation where many logics using middleware cannot be implemented.
Reproduction
export default defineNuxtPlugin((nuxtApp) => { const runtimeConfig = useRuntimeConfig(); const auth0 = createAuth0({ domain: runtimeConfig.public.auth0Domain, clientId: runtimeConfig.public.auth0ClientId, authorizationParams: { redirect_uri:
https://${window.location.hostname}:3000/callback/
, scope: "openid profile email", audience: runtimeConfig.public.auth0Audience, }, });nuxtApp.vueApp.use(auth0); });
export default defineNuxtRouteMiddleware((to, from) => { console.log(to.path); console.log(from.path); });