mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-08-11 11:13:12 +08:00
allow to enable/disable email sigin via env variable
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -80,7 +80,9 @@ function Signin({ providers }: SigninProps) {
|
||||
<AuthLayout>
|
||||
<Stack spacing="2">
|
||||
{credentials && <DebugSigninForm providerId={credentials.id} bgColorClass={bgColorClass} />}
|
||||
{email && <EmailSignInForm providerId={email.id}></EmailSignInForm>}
|
||||
{email && boolean(process.env.NEXT_PUBLIC_ENABLE_EMAIL_SIGNIN) && (
|
||||
<EmailSignInForm providerId={email.id}></EmailSignInForm>
|
||||
)}
|
||||
{discord && (
|
||||
<Button
|
||||
bg={buttonBgColor}
|
||||
|
||||
Reference in New Issue
Block a user