From 0c2868257c855f5c2e666bd2b6ed8f4fc64dc0bf Mon Sep 17 00:00:00 2001 From: waleed Date: Wed, 21 Jan 2026 17:42:03 -0800 Subject: [PATCH] fix(auth): handle EMAIL_NOT_VERIFIED in onError callback --- apps/sim/app/(auth)/login/login-form.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/sim/app/(auth)/login/login-form.tsx b/apps/sim/app/(auth)/login/login-form.tsx index a259a036f..6502c1c93 100644 --- a/apps/sim/app/(auth)/login/login-form.tsx +++ b/apps/sim/app/(auth)/login/login-form.tsx @@ -213,9 +213,12 @@ export default function LoginPage({ onError: (ctx) => { logger.error('Login error:', ctx.error) - // EMAIL_NOT_VERIFIED is handled by the catch block which redirects to /verify if (ctx.error.code?.includes('EMAIL_NOT_VERIFIED')) { errorHandled = true + if (typeof window !== 'undefined') { + sessionStorage.setItem('verificationEmail', email) + } + router.push('/verify') return }