Commit Graph

13 Commits

Author SHA1 Message Date
colinislit
caeba77bf8 chore(strip): verwijder /epd/clients redirect-laag
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>
2026-07-14 22:50:52 +02:00
colinislit
6fcb9a0e7b feat: migrate clients module to patients + add docs 2025-11-23 10:13:00 +01:00
colinislit
d680cf4985 route.ts 2025-11-19 15:33:03 +01:00
colinislit
e6234fe3de callback / debug 2025-11-19 15:26:29 +01:00
colinislit
74436dad08 tokenhash parameter 2025-11-19 14:23:54 +01:00
colinislit
d32b47407b callback routes 2025-11-19 12:22:52 +01:00
colinislit
bc26313859 update/reset password 2025-11-19 12:13:48 +01:00
colinislit
d01eb0ba69 fix: password reset redirect naar update-password pagina 2025-11-19 12:09:40 +01:00
colinislit
1c305c7d1e fix: password reset email now redirects to update-password page
**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>
2025-11-19 12:02:22 +01:00
colinislit
9dd129c258 docs: improve auth flow documentation and fix email confirmation redirect
**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>
2025-11-19 11:38:57 +01:00
colinislit
2505b27437 feat: add duplicate email detection via auth hook with fallback
- 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
2025-11-19 11:03:46 +01:00
colinislit
273c00f9e8 Epic 2: Design System Migration - Teal-first implementatie
 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>
2025-11-17 17:38:22 +01:00
colinislit
99804656d7 RLS policies implementeren, Demo auth flow 2025-11-15 23:59:38 +01:00