From 67d33bb341a6d86c2f5218ae4aacaa4792551469 Mon Sep 17 00:00:00 2001 From: Zoey Kaiser Date: Mon, 22 Jan 2024 10:59:41 +0100 Subject: [PATCH] Revert: https://github.com/sidebase/nuxt-auth/pull/644 --- src/runtime/middleware/auth.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/runtime/middleware/auth.ts b/src/runtime/middleware/auth.ts index a1547f71..8e6109df 100644 --- a/src/runtime/middleware/auth.ts +++ b/src/runtime/middleware/auth.ts @@ -85,10 +85,6 @@ export default defineNuxtRouteMiddleware((to) => { } if (authConfig.provider.type === 'authjs') { - // If the middleware runs on a pre-render of the route, do not call signIn, as this is a client method - if (process.server) { - return - } 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