Alle verwijzingen (middleware, login, auth-callback, set-password,
Cortex context-bar) wijzen nu rechtstreeks naar /epd/patients; de
backwards-compat redirects zijn daarmee overbodig.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
**Problem:**
Password reset emails redirected users to homepage with ?code= parameter,
leaving users stuck without ability to set new password.
**Root Cause:**
Auth callback route didn't detect password recovery flow. When Supabase
sent users back with type=recovery parameter, the callback defaulted to
/epd/clients redirect instead of /update-password.
**Solution:**
- Detect `type=recovery` parameter in auth callback route
- Always redirect password recovery flows to /update-password
- Preserves existing flows (signup, magic link) unchanged
**Flow now:**
1. User clicks reset link in email
2. Supabase verifies token → redirect to homepage with ?code=&type=recovery
3. Middleware redirects to /auth/callback?code=&type=recovery
4. Callback detects type=recovery → redirect to /update-password ✅
5. User can set new password
This fix ensures password reset works regardless of Supabase redirect_to
configuration, making the flow more resilient.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
**Auth Callback Improvements:**
- Fix default redirect from /clients to /epd/clients (correct route)
- Add smart detection for password vs magic link users
- Password signup users now go directly to /epd/clients after email confirmation
- Magic link users still get optional /set-password page
**Documentation:**
- Add comprehensive AUTH_FLOW_EXPLAINED.md with step-by-step flow diagrams
- Update RELEASE_AUTH_IMPROVEMENTS.md with magic link migration instructions
- Update emails/README.md with aispeedrun.nl redirect URL configuration
- Document Site URL vs Redirect URLs difference
- Add troubleshooting for common issues (localhost in emails, invalid redirect)
**Key Changes:**
- Email confirmation now correctly redirects password users to EPD
- Clear instructions for Supabase configuration (Site URL + Redirect URLs)
- Both development and production URLs documented for dual environment support
All documentation includes practical examples and FAQ section.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add before-user-created hook function for server-side duplicate email detection
- Implement fallback detection using identities array check (Supabase limitation)
- Update signUpWithPassword to detect duplicate emails via hook errors or empty identities
- Add error handling in login page to show duplicate email errors and auto-switch to login mode
- Add auth hook setup documentation and test scripts
- Add password reset and update password flows
- Add email templates for signup confirmation and password reset
✅ E2.S1: Tailwind config update
- Teal-700 (#0F766E) als PRIMARY brand color (5.47:1 contrast)
- Amber-600→700 gradient voor AI features
- Updated ring color naar teal-700 voor WCAG AA
✅ E2.S2: Global CSS variables
- --color-brand → teal-700 (was blue-600)
- --color-info → teal-700 (was blue-500)
- --color-input-focus → teal-700 (was blue-500)
- --color-ai toegevoegd → amber-600
✅ E2.S3: Component color updates
- components/ui/sign-in.tsx: Alle blue → teal
- components/ui/timeline.tsx: Gradient blue → teal
- components/ui/reading-progress.tsx: Progress bar blue → teal
- components/ui/modern-side-bar.tsx: Logo, active states blue → teal
✅ E2.S4: AIButton component
- Nieuw component: components/ui/ai-button.tsx
- Amber-600→700 gradient voor WCAG compliance
- 3 variants: default, outline, ghost
- Loading state + Sparkles icon
- Fully accessible (WCAG AA focus states)
✅ E2.S5: Contrast testing
- scripts/test-contrast.ts: Automated WCAG testing
- docs/design/wcag-compliance.md: Compliance documentatie
- Resultaten: 7/11 AA Normal (4.5:1), 11/11 AA Large (3:1) ✅
WCAG AA Compliance: ✅ PASS
- Teal-700 op wit: 5.47:1 (AA Normal)
- White op teal-700: 5.47:1 (AA Normal)
- White op amber-600: 3.19:1 (AA Large - OK voor buttons)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>