Allow to enable/disable email signin via env variable
diff --git a/docker-compose.yaml b/docker-compose.yaml
index 1ea1e680c9..5d9955bf49 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -128,6 +128,7 @@ services:
       - NEXT_PUBLIC_CLOUDFARE_CAPTCHA_SITE_KEY=1x00000000000000000000AA
       - CLOUDFLARE_CAPTCHA_SECRET_KEY=1x0000000000000000000000000000000AA
       - NEXT_PUBLIC_ENABLE_EMAIL_SIGNIN_CAPTCHA=true
+      - NEXT_PUBLIC_ENABLE_EMAIL_SIGNIN=true
     depends_on:
       webdb:
         condition: service_healthy
diff --git a/website/.env b/website/.env
index e81374e761..50ecb4982d 100644
--- a/website/.env
+++ b/website/.env
@@ -19,5 +19,6 @@ EMAIL_SERVER_PORT=1025
 EMAIL_FROM=info@example.com
 
 NEXT_PUBLIC_CLOUDFLARE_CAPTCHA_SITE_KEY=1x00000000000000000000AA
-CLOUDFLARE_CAPTCHA_SERCERT_KEY=1x0000000000000000000000000000000AA
+CLOUDFLARE_CAPTCHA_SECRET_KEY=1x0000000000000000000000000000000AA
 NEXT_PUBLIC_ENABLE_EMAIL_SIGNIN_CAPTCHA=false
+NEXT_PUBLIC_ENABLE_EMAIL_SIGNIN=true
diff --git a/website/src/pages/api/auth/[...nextauth].ts b/website/src/pages/api/auth/[...nextauth].ts
index 5a316256f3..5b763b2c6f 100644
--- a/website/src/pages/api/auth/[...nextauth].ts
+++ b/website/src/pages/api/auth/[...nextauth].ts
@@ -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));
diff --git a/website/src/pages/auth/signin.tsx b/website/src/pages/auth/signin.tsx
index b65fa74262..62cd93f756 100644
--- a/website/src/pages/auth/signin.tsx
+++ b/website/src/pages/auth/signin.tsx
@@ -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}
diff --git a/website/types/env.d.ts b/website/types/env.d.ts
index f81897afc4..398174895e 100644
--- a/website/types/env.d.ts
+++ b/website/types/env.d.ts
@@ -5,6 +5,7 @@ declare global {
       NEXT_PUBLIC_CLOUDFLARE_CAPTCHA_SITE_KEY: string;
       CLOUDFLARE_CAPTCHA_SECRET_KEY: string;
       NEXT_PUBLIC_ENABLE_EMAIL_SIGNIN_CAPTCHA: boolean;
+      NEXT_PUBLIC_ENABLE_EMAIL_SIGNIN: boolean;
     }
   }
 }

close #911 