Problem
User identity is currently stored in localStorage (watchlist_user_id). This is fragile because:
- Browser can clear localStorage automatically (storage pressure, privacy settings)
- Users lose all their preferences if the key is lost
- No way to access data from another device
- Data becomes orphaned in the database with no way to recover
Current Flow
- First visit → create anonymous user → store UUID in localStorage
- Return visit → read UUID from localStorage → load user data
- localStorage cleared → data loss (new user created, old data orphaned)
Proposed Solution
Add proper authentication with multiple options:
Option 1: Email-based auth (Recommended)
- Email + password registration
- "Magic link" passwordless login option
- Can migrate existing anonymous users by adding email to their account
Option 2: OAuth providers
- Google / GitHub / Apple sign-in
- Simpler UX but requires OAuth setup
Option 3: Device fingerprinting + email backup
- Keep anonymous users but prompt for email as backup
- Use email to recover if localStorage is lost
Implementation Notes
- Use existing auth service at
auth.adaptiveedge.uk if possible
- Add migration path for existing anonymous users
- Consider adding "Link your account" prompt after onboarding
Acceptance Criteria
This issue was created after a user lost all their preference data due to localStorage being cleared
Problem
User identity is currently stored in
localStorage(watchlist_user_id). This is fragile because:Current Flow
Proposed Solution
Add proper authentication with multiple options:
Option 1: Email-based auth (Recommended)
Option 2: OAuth providers
Option 3: Device fingerprinting + email backup
Implementation Notes
auth.adaptiveedge.ukif possibleAcceptance Criteria
This issue was created after a user lost all their preference data due to localStorage being cleared