Skip to content

Instantly share code, notes, and snippets.

View Mingling94's full-sized avatar

Ming Luo Mingling94

  • Seattle, WA
View GitHub Profile
@Mingling94
Mingling94 / README.md
Created May 8, 2026 02:48
React + Supabase test-mode auth session pattern

React + Supabase Test-Mode Auth Session Pattern

This is a small public reference for a focused React + Supabase auth persistence bug.

Goal:

  • Keep Supabase Auth as the real production auth provider.
  • Add deterministic test-mode auth only for staging/test environments.
  • Avoid writing fake tokens into Supabase's own auth storage.
  • Let route guards recognize either a real Supabase session or a separately stored test-mode session.
  • Preserve reload behavior for Playwright and manual staging tests.