fix: update auth-options
This commit is contained in:
@@ -164,13 +164,15 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async signIn({ user }) {
|
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') {
|
if (process.env.NEXT_PUBLIC_DISABLE_SIGNUP === 'true') {
|
||||||
const userData = await getUserByEmail({ email: user.email! });
|
const userData = await getUserByEmail({ email: user.email! });
|
||||||
|
|
||||||
return !!userData;
|
return !!userData;
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user