Fix Oauth redirect when not logged in
This commit is contained in:
parent
5228c12747
commit
322da8aa56
1 changed files with 4 additions and 1 deletions
|
|
@ -52,7 +52,10 @@ export const useAuth = () => {
|
|||
const redirectTo = route.query.redirect as string
|
||||
|
||||
if (redirectTo && redirectTo.startsWith('/')) {
|
||||
await navigateTo(redirectTo)
|
||||
// Force a full-page navigation so server-only routes (e.g. /oauth/authorize)
|
||||
// are reached. SPA navigation falls through the Nuxt pages router and hits
|
||||
// the [...slug].vue catch-all, which never invokes the server handler.
|
||||
await navigateTo(redirectTo, { external: true })
|
||||
} else {
|
||||
await navigateTo('/')
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue