Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Fix EMAIL_NOT_VERIFIED error handling in login form
  • Error via onError callback now properly redirects to /verify instead of leaving user stuck

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Jan 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 22, 2026 2:25am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 22, 2026

Greptile Summary

Fixed EMAIL_NOT_VERIFIED error handling in login form by adding proper redirect logic to the onError callback. Previously, when this error occurred, the callback would only set errorHandled = true without actually redirecting the user to the verification page, leaving users stuck on the login screen.

  • Added sessionStorage.setItem('verificationEmail', email) to store the email for the verification page
  • Added router.push('/verify') to redirect users to email verification
  • Removed misleading comment claiming the catch block handles this case (the onError callback executes first, preventing the catch block from running)
  • Matches the existing pattern used in the signup form at apps/sim/app/(auth)/signup/signup-form.tsx:330
  • The catch block at line 288 still provides fallback handling for edge cases where the error might not be caught by the onError callback

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a straightforward bug fix that adds the missing redirect logic for unverified email errors. The implementation follows the existing pattern used in the signup form, uses proper SSR checks (typeof window !== 'undefined'), and correctly sets the email in sessionStorage before redirecting. The fallback catch block at line 288 remains in place for redundancy.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/app/(auth)/login/login-form.tsx Fixed EMAIL_NOT_VERIFIED error handling by adding proper redirect logic and sessionStorage update in onError callback

Sequence Diagram

sequenceDiagram
    participant U as User
    participant LF as Login Form
    participant AC as Auth Client
    participant SS as SessionStorage
    participant R as Router
    participant VP as Verify Page

    U->>LF: Submit login credentials
    LF->>AC: signIn.email()
    AC-->>LF: onError: EMAIL_NOT_VERIFIED
    LF->>LF: Set errorHandled = true
    LF->>SS: setItem('verificationEmail', email)
    LF->>R: push('/verify')
    R->>VP: Navigate to /verify
    VP->>SS: getItem('verificationEmail')
    VP->>U: Display verification form with email
Loading

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@waleedlatif1 waleedlatif1 merged commit f3fcc28 into staging Jan 22, 2026
11 checks passed
waleedlatif1 added a commit that referenced this pull request Jan 22, 2026
* fix(zustand): updated to useShallow from deprecated createWithEqualityFn (#2919)

* fix(logger): use direct env access for webpack inlining (#2920)

* fix(notifications): text overflow with line-clamp (#2921)

* chore(helm): add env vars for Vertex AI, orgs, and telemetry (#2922)

* fix(auth): improve reset password flow and consolidate brand detection (#2924)

* fix(auth): improve reset password flow and consolidate brand detection

* fix(auth): set errorHandled for EMAIL_NOT_VERIFIED to prevent duplicate error

* fix(auth): clear success message on login errors

* chore(auth): fix import order per lint

* fix(action-bar): duplicate subflows with children (#2923)

* fix(action-bar): duplicate subflows with children

* fix(action-bar): add validateTriggerPaste for subflow duplicate

* fix(resolver): agent response format, input formats, root level (#2925)

* fix(resolvers): agent response format, input formats, root level

* fix response block initial seeding

* fix tests

* fix(messages-input): fix cursor alignment and auto-resize with overlay (#2926)

* fix(messages-input): fix cursor alignment and auto-resize with overlay

* fixed remaining zustand warnings

* fix(stores): remove dead code causing log spam on startup (#2927)

* fix(stores): remove dead code causing log spam on startup

* fix(stores): replace custom tools zustand store with react query cache

* improvement(ui): use BrandedButton and BrandedLink components (#2930)

- Refactor auth forms to use BrandedButton component
- Add BrandedLink component for changelog page
- Reduce code duplication in login, signup, reset-password forms
- Update star count default value

* fix(custom-tools): remove unsafe title fallback in getCustomTool (#2929)

* fix(custom-tools): remove unsafe title fallback in getCustomTool

* fix(custom-tools): restore title fallback in getCustomTool lookup

Custom tools are referenced by title (custom_${title}), not database ID.
The title fallback is required for client-side tool resolution to work.

* fix(null-bodies): empty bodies handling (#2931)

* fix(null-statuses): empty bodies handling

* address bugbot comment

* fix(token-refresh): microsoft, notion, x, linear (#2933)

* fix(microsoft): proactive refresh needed

* fix(x): missing token refresh flag

* notion and linear missing flag too

* address bugbot comment

* fix(auth): handle EMAIL_NOT_VERIFIED in onError callback (#2932)

* fix(auth): handle EMAIL_NOT_VERIFIED in onError callback

* refactor(auth): extract redirectToVerify helper to reduce duplication

* fix(workflow-selector): use dedicated selector for workflow dropdown (#2934)

* feat(workflow-block): preview (#2935)

* improvement(copilot): tool configs to show nested props (#2936)

* fix(auth): add genericOAuth providers to trustedProviders (#2937)

---------

Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com>
Co-authored-by: Emir Karabeg <78010029+emir-karabeg@users.noreply.github.com>
@waleedlatif1 waleedlatif1 deleted the fix/email branch January 22, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants