pounce/frontend
yves.gugger 811e4776c8 fix: Seamless user journey for register/login/Stripe
PROBLEM: Redirect parameters were getting lost during user flows

FIXES APPLIED:

1. Register Page:
   - Default redirect: /command/dashboard (was /dashboard)
   - Stores redirect in localStorage before email verification
   - Preserves redirect when linking to login page

2. Login Page:
   - Checks localStorage for stored redirect (from registration)
   - Clears stored redirect after successful login
   - Uses useState for dynamic redirect handling

3. OAuth Callback:
   - Default redirect: /command/dashboard (was /dashboard)
   - Backend OAuth endpoints also updated

4. Fixed all /dashboard → /command/dashboard links:
   - pricing/page.tsx
   - page.tsx (landing page)
   - AdminLayout.tsx
   - DomainChecker.tsx
   - command/dashboard/page.tsx
   - Header.tsx (simplified check)

5. Backend OAuth:
   - Default redirect_path: /command/dashboard

NEW USER JOURNEY:

Pricing → Register → Email Verify → Login → Pricing → Stripe
                                                    ↓
                                            Welcome Page
                                                    ↓
                                              Dashboard

The redirect is preserved throughout:
- Query param ?redirect=/pricing passed through register/login
- Stored in localStorage during email verification gap
- Cleaned up after successful login

STRIPE FLOW CLARIFICATION:
- Stripe does NOT create users
- Users must register FIRST with email/password
- Then they can upgrade via Stripe checkout
- This is by design for security and flexibility
2025-12-10 16:23:16 +01:00
..
2025-12-09 08:29:31 +01:00