From 59a17f55d775b0931ee7de23f710f3544337e756 Mon Sep 17 00:00:00 2001 From: Abdallah Alhaddad <54389201+AbdallahAlhaddad@users.noreply.github.com> Date: Mon, 22 Jan 2024 01:34:59 -0800 Subject: [PATCH] fix: include hash & query parameters in callbackUrl (#643) --- src/runtime/middleware/auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/middleware/auth.ts b/src/runtime/middleware/auth.ts index c2f3badb..a1547f71 100644 --- a/src/runtime/middleware/auth.ts +++ b/src/runtime/middleware/auth.ts @@ -89,7 +89,7 @@ export default defineNuxtRouteMiddleware((to) => { if (process.server) { return } - const signInOptions: Parameters[1] = { error: 'SessionRequired', callbackUrl: determineCallbackUrl(authConfig, () => to.path) } + const signInOptions: Parameters[1] = { error: 'SessionRequired', callbackUrl: determineCallbackUrl(authConfig, () => to.fullPath) } // @ts-ignore This is valid for a backend-type of `authjs`, where sign-in accepts a provider as a first argument return signIn(undefined, signInOptions) as ReturnType } else if (typeof metaAuth === 'object' && metaAuth.navigateUnauthenticatedTo) {