From 0158e58d9036a51fc465b94647b23b4c681fdb84 Mon Sep 17 00:00:00 2001 From: phillibl Date: Wed, 7 Aug 2024 05:29:10 -0400 Subject: [PATCH] Update [...nextauth].ts Fixed issue where sign in would fail for existing user if DISABLE_NEW_SSO_USERS = true --- pages/api/v1/auth/[...nextauth].ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/api/v1/auth/[...nextauth].ts b/pages/api/v1/auth/[...nextauth].ts index 17bcaad..7b6315f 100644 --- a/pages/api/v1/auth/[...nextauth].ts +++ b/pages/api/v1/auth/[...nextauth].ts @@ -1186,7 +1186,7 @@ export default async function auth(req: NextApiRequest, res: NextApiResponse) { providerAccountId: account?.providerAccountId, }, }); - if (existingUser && newSsoUsersDisabled) { + if (!existingUser && newSsoUsersDisabled) { return false; } }