allow to enable/disable email sigin via env variable

This commit is contained in:
notmd
2023-02-02 00:29:46 +07:00
parent 2d97ffa371
commit 0b9b8ed927
5 changed files with 10 additions and 1 deletions
@@ -165,6 +165,10 @@ export default function auth(req: NextApiRequest, res: NextApiResponse) {
return true;
}
if (account.provider === "email" && !boolean(process.env.NEXT_PUBLIC_ENABLE_EMAIL_SIGNIN)) {
return false;
}
const captcha = req.body.captcha;
const res = await checkCaptcha(captcha, getIp(req));