fix: update auth-options

This commit is contained in:
Lucas Smith
2023-12-15 20:41:54 +11:00
committed by GitHub
parent 5c1d30bfbb
commit 682cb37786

View File

@ -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;
},
},
};