allow to enable/disable email signin captcha via env variable

This commit is contained in:
notmd
2023-01-29 23:28:26 +07:00
parent fce158b8d3
commit fb26a52c2c
5 changed files with 20 additions and 7 deletions
+1 -1
View File
@@ -161,7 +161,7 @@ export default function auth(req: NextApiRequest, res: NextApiResponse) {
callbacks: {
...authOptions.callbacks,
async signIn({ account }) {
if (account.provider !== "email") {
if (account.provider !== "email" || !boolean(process.env.NEXT_PUBLIC_ENABLE_EMAIL_SIGNIN_CAPTCHA)) {
return true;
}