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>
This commit is contained in:
colinislit
2025-11-19 11:38:57 +01:00
parent 2fcf609e27
commit 9dd129c258
4 changed files with 281 additions and 9 deletions

View File

@@ -49,6 +49,40 @@ Alle foutmeldingen zijn nu duidelijker en helpen je beter op weg:
---
## 📋 Voor Bestaande Magic Link Gebruikers
Heb je je eerder aangemeld met een magic link en wil je nu ook met een wachtwoord kunnen inloggen? Dat kan!
### Hoe stel je een wachtwoord in?
1. **Ga naar de wachtwoord reset pagina**
- Klik op "Wachtwoord vergeten?" op de login pagina
- Of ga direct naar `/reset-password`
2. **Vul je email in**
- Gebruik hetzelfde emailadres waarmee je via magic link inlogt
- Klik op "Stuur Reset Link"
3. **Check je inbox**
- Je ontvangt binnen enkele minuten een email
- Klik op de link in de email (geldig voor 1 uur)
4. **Stel je wachtwoord in**
- Kies een sterk wachtwoord (minimaal 8 tekens)
- Bevestig het wachtwoord
- Klaar!
### Na het instellen van een wachtwoord
Je kunt nu kiezen hoe je wilt inloggen:
- 🔑 **Met wachtwoord** - Sneller, direct inloggen zonder email te checken
- ✉️ **Met magic link** - Blijft ook gewoon werken zoals voorheen
Beide methodes blijven beschikbaar, je kiest zelf wat je het prettigst vindt!
---
## 🚀 Voor Ontwikkelaars
De volgende functies zijn toegevoegd aan `lib/auth/client.ts`: