13 Commits

Author SHA1 Message Date
colinislit
06287d49f4 refactor(login): update interface preference from 'swift' to 'cortex'
- Changed default interface preference in LoginForm component from 'klassiek' to 'cortex'.
- Updated redirect path logic to reflect the new 'cortex' preference.
- Modified button label and state management to align with the new interface preference terminology.
- Adjusted type definition for InterfacePreference to include 'cortex' instead of 'swift'.
2025-12-31 10:08:22 +01:00
colinislit
d67405df5f feat(swift): Epic 4 - Navigation & Auth compleet
E4.S1 - Login form uitbreiden:
- Interface selector (Swift/Klassiek) toegevoegd
- Visuele keuze met icons (Layout/Zap)
- Redirect naar gekozen interface na login

E4.S2 - Preference opslag:
- updateInterfacePreference() in lib/auth/client.ts
- getInterfacePreference() voor ophalen
- Opslag in user_metadata.preferred_interface

E4.S3 - Redirect middleware:
- /epd → redirect naar preferred interface
- /login → redirect naar preferred interface (als ingelogd)
- Default: klassiek (/epd/clients)

E4.S4 - Fallback Picker:
- FallbackPicker component voor lage confidence
- Grid met 3 opties (Notitie, Zoeken, Overdracht)
- Keyboard shortcuts [1], [2], [3]
- Toont originele input voor context

Voortgang: Epic 4 compleet (8 SP)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 09:28:10 +01:00
colinislit
982b23c4dc fix: consolidate database types to single source of truth
BREAKING: Removed duplicate lib/database.types.ts in favor of
lib/supabase/database.types.ts

Problem:
- Database types existed in two locations causing sync issues
- Old lib/database.types.ts was empty (0 bytes)
- Import paths were inconsistent across codebase
- Build failed due to missing type definitions

Solution:
- Generated fresh types from remote Supabase database
- Updated all imports from @/lib/database.types to @/lib/supabase/database.types
- Removed duplicate lib/database.types.ts file

Affected modules:
- lib/auth/server.ts - Auth server utilities
- lib/auth/client.ts - Auth client utilities
- lib/types/client.ts - Client type definitions
- lib/fhir/transforms/patient.ts - FHIR patient transforms
- lib/fhir/transforms/practitioner.ts - FHIR practitioner transforms

Impact: All database queries now use up-to-date type definitions
including new tables (intakes, risk_assessments, encounters, etc.)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 12:19:47 +01:00
colinislit
74436dad08 tokenhash parameter 2025-11-19 14:23:54 +01:00
colinislit
4f5d99717b page.tsx / client.tsx 2025-11-19 13:45:44 +01:00
colinislit
55c30b17f5 password route 2025-11-19 12:26:12 +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
2fcf609e27 feat: enhance authentication UX with password visibility toggle and better error messages
Added comprehensive improvements to the login and authentication flow:

**UI Improvements:**
- Add password visibility toggle (Eye/EyeOff icons) for password fields
- Improve error message consistency with Dutch translations
- Fix syntax error in login page try-catch block

**Error Handling:**
- Add user-friendly error messages for invalid credentials
- Add specific error codes: invalid_credentials, email_not_confirmed
- Improve error message for non-existent accounts during login
- Handle duplicate email detection during signup with auto-switch to login mode

**Middleware:**
- Add /reset-password and /update-password to public routes
- Fix redirect issue preventing access to password reset flow

**Password Reset Flow:**
- Verify password reset works for magic link users (can set initial password)
- Ensure existing password users can reset their password
- Both flows use the same update mechanism via Supabase

**Documentation:**
- Add comprehensive release notes in docs/RELEASE_AUTH_IMPROVEMENTS.md

All changes maintain backward compatibility with existing magic link users.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 11:24:28 +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