From 078e5ba95f7aa46ee068dbeeef12f3c26ad5212f Mon Sep 17 00:00:00 2001 From: daniel31x13 Date: Mon, 19 Aug 2024 19:30:01 -0400 Subject: [PATCH] minor change --- pages/api/v1/auth/[...nextauth].ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/api/v1/auth/[...nextauth].ts b/pages/api/v1/auth/[...nextauth].ts index 8b97c04..2351fdd 100644 --- a/pages/api/v1/auth/[...nextauth].ts +++ b/pages/api/v1/auth/[...nextauth].ts @@ -1179,14 +1179,14 @@ export default async function auth(req: NextApiRequest, res: NextApiResponse) { }, callbacks: { async signIn({ user, account, profile, email, credentials }) { - if (account?.provider !== "credentials" && newSsoUsersDisabled) { + if (account?.provider !== "credentials") { // registration via SSO can be separately disabled const existingUser = await prisma.account.findFirst({ where: { providerAccountId: account?.providerAccountId, }, }); - if (!existingUser) { + if (!existingUser && newSsoUsersDisabled) { return false; } }