From 682cb37786ea6ac78cdefb88063d000110d02c1d Mon Sep 17 00:00:00 2001 From: Lucas Smith Date: Fri, 15 Dec 2023 20:41:54 +1100 Subject: [PATCH] fix: update auth-options --- packages/lib/next-auth/auth-options.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/lib/next-auth/auth-options.ts b/packages/lib/next-auth/auth-options.ts index 1d900c391..3b9492807 100644 --- a/packages/lib/next-auth/auth-options.ts +++ b/packages/lib/next-auth/auth-options.ts @@ -164,13 +164,15 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = { }, async signIn({ user }) { + // We do this to stop OAuth providers from creating an account + // when signups are disabled if (process.env.NEXT_PUBLIC_DISABLE_SIGNUP === 'true') { const userData = await getUserByEmail({ email: user.email! }); return !!userData; - } else { - return true; } + + return true; }, }, };