From a6aae0cea1c17010b224c1823413f08feff26c67 Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 19 Nov 2025 23:52:04 +0000 Subject: [PATCH] fix(cloud): reenable magic login --- apps/web/src/components/AuthForm.tsx | 36 ++++++++++++++++------------ 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/apps/web/src/components/AuthForm.tsx b/apps/web/src/components/AuthForm.tsx index 784c722c..978c2a00 100644 --- a/apps/web/src/components/AuthForm.tsx +++ b/apps/web/src/components/AuthForm.tsx @@ -303,6 +303,10 @@ export function Auth({ setIsMagicLinkSent, isSignUp }: AuthProps) { const password = watch("password"); + const isMagicLinkAvailable = useMemo(() => { + return isCloudEnv || (isEmailSendingEnabled && !isSignUp); + }, [isCloudEnv, isEmailSendingEnabled, isSignUp]); + // Determine if we should operate in magic link mode for current form state (login only) const isMagicLinkMode = useMemo(() => { // Magic link only viable when email sending enabled AND not sign up. @@ -390,7 +394,7 @@ export function Auth({ setIsMagicLinkSent, isSignUp }: AuthProps) { )} )} - {isCredentialsEnabled && ( + {(isCredentialsEnabled || isMagicLinkAvailable) && ( <>
-
- - {errors.password && ( -

- {errors.password.message ?? - t`Please enter a valid password`} -

- )} -
+ {isCredentialsEnabled && ( +
+ + {errors.password && ( +

+ {errors.password.message ?? + t`Please enter a valid password`} +

+ )} +
+ )} )} {loginError && (

{loginError}

)}
- {isCredentialsEnabled && ( + {(isCredentialsEnabled || isMagicLinkAvailable) && (