File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,7 @@ const availableSocialProviders = {
153153} ;
154154
155155export function Auth ( { setIsMagicLinkSent, isSignUp } : AuthProps ) {
156+ const [ isCloudEnv , setIsCloudEnv ] = useState ( false ) ;
156157 const [ isLoginWithProviderPending , setIsLoginWithProviderPending ] =
157158 useState < null | AuthProvider > ( null ) ;
158159 const [ isCredentialsEnabled , setIsCredentialsEnabled ] = useState ( false ) ;
@@ -172,6 +173,8 @@ export function Auth({ setIsMagicLinkSent, isSignUp }: AuthProps) {
172173 env ( "NEXT_PUBLIC_ALLOW_CREDENTIALS" ) ?. toLowerCase ( ) === "true" ;
173174 const emailSendingEnabled =
174175 env ( "NEXT_PUBLIC_DISABLE_EMAIL" ) ?. toLowerCase ( ) !== "true" ;
176+ const isCloudEnv = env ( "NEXT_PUBLIC_KAN_ENV" ) === "cloud" ;
177+ setIsCloudEnv ( isCloudEnv ) ;
175178 setIsEmailSendingEnabled ( emailSendingEnabled ) ;
176179 setIsCredentialsEnabled ( credentialsAllowed ) ;
177180 } , [ ] ) ;
@@ -236,7 +239,7 @@ export function Auth({ setIsMagicLinkSent, isSignUp }: AuthProps) {
236239 }
237240 } else {
238241 // Only allow magic link if email sending is enabled and not in sign up mode
239- if ( isEmailSendingEnabled && ! isSignUp ) {
242+ if ( isCloudEnv || ( isEmailSendingEnabled && ! isSignUp ) ) {
240243 await authClient . signIn . magicLink (
241244 {
242245 email,
You can’t perform that action at this time.
0 commit comments