fix: redirect unverified users to verification page (#53) #54

Merged
egullickson merged 1 commits from issue-53-login-button-unverified-users into main 2026-01-18 19:45:55 +00:00
Owner

Summary

  • Fixes unresponsive Login button for unverified users on landing page
  • Checks for pendingVerificationEmail in localStorage (set during signup)
  • Redirects to /verify-email page instead of attempting Auth0 login
  • Existing verification page infrastructure handles the rest

Root Cause

When an unverified user clicks Login:

  1. If Auth0 session exists, isAuthenticated is true, navigates to /garage
  2. Auth gate may never become ready (token acquisition fails for unverified users)
  3. Results in "Initializing session..." spinner forever or silent redirect back

Solution

Before calling loginWithRedirect, check if the user has a pending verification:

const pendingVerificationEmail = localStorage.getItem('pendingVerificationEmail');
if (pendingVerificationEmail) {
  navigate('/verify-email', { state: { email: pendingVerificationEmail } });
  return;
}

Test Plan

  • Sign up with new email, do NOT verify
  • Navigate to landing page
  • Click Login button
  • Should redirect to /verify-email page with email displayed
  • Test on desktop viewport
  • Test on mobile viewport

Fixes #53

## Summary - Fixes unresponsive Login button for unverified users on landing page - Checks for `pendingVerificationEmail` in localStorage (set during signup) - Redirects to `/verify-email` page instead of attempting Auth0 login - Existing verification page infrastructure handles the rest ## Root Cause When an unverified user clicks Login: 1. If Auth0 session exists, `isAuthenticated` is true, navigates to `/garage` 2. Auth gate may never become ready (token acquisition fails for unverified users) 3. Results in "Initializing session..." spinner forever or silent redirect back ## Solution Before calling `loginWithRedirect`, check if the user has a pending verification: ```typescript const pendingVerificationEmail = localStorage.getItem('pendingVerificationEmail'); if (pendingVerificationEmail) { navigate('/verify-email', { state: { email: pendingVerificationEmail } }); return; } ``` ## Test Plan - [ ] Sign up with new email, do NOT verify - [ ] Navigate to landing page - [ ] Click Login button - [ ] Should redirect to /verify-email page with email displayed - [ ] Test on desktop viewport - [ ] Test on mobile viewport Fixes #53
egullickson added 1 commit 2026-01-18 19:40:18 +00:00
fix: redirect unverified users to verification page from Login button (refs #53)
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 2m46s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 29s
Deploy to Staging / Verify Staging (pull_request) Successful in 7s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 6s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped
c7df092d78
When a user signs up but doesn't verify their email, clicking the Login
button on the landing page would either do nothing or get stuck in a
loading state. Now checks for pendingVerificationEmail in localStorage
(set during signup) and redirects to /verify-email instead of attempting
Auth0 login.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
egullickson merged commit 66a6d9e30c into main 2026-01-18 19:45:55 +00:00
egullickson deleted branch issue-53-login-button-unverified-users 2026-01-18 19:45:55 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: egullickson/motovaultpro#54