Skip to content

Commit 0c28682

Browse files
committed
fix(auth): handle EMAIL_NOT_VERIFIED in onError callback
1 parent 5987a6d commit 0c28682

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/sim/app/(auth)/login/login-form.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,12 @@ export default function LoginPage({
213213
onError: (ctx) => {
214214
logger.error('Login error:', ctx.error)
215215

216-
// EMAIL_NOT_VERIFIED is handled by the catch block which redirects to /verify
217216
if (ctx.error.code?.includes('EMAIL_NOT_VERIFIED')) {
218217
errorHandled = true
218+
if (typeof window !== 'undefined') {
219+
sessionStorage.setItem('verificationEmail', email)
220+
}
221+
router.push('/verify')
219222
return
220223
}
221224

0 commit comments

Comments
 (0)