- Persist `roles` array in localStorage on login and session restore.
- Reconcile `userType` from roles returned by the `user-info` function.
- `ProtectedRoute` now accepts `requiredUserType?: UserType[]` and `requiredRoles?: string[]` and evaluates multi-role permission (OR semantics).
- Minor adjustments in `useAuth` and debug logs to ensure consistent `profile` and `roles` restoration.
- Main files changed: `hooks/useAuth.tsx`, `components/ProtectedRoute.tsx`, `types/auth.ts.
- Removido fallback Direct Auth no frontend
- Removida tentativa de atribuir role no cliente
- Mensagens de erro aprimoradas para 'failed to assign user role' e email duplicado
- Atualizados formulários de médico e paciente para instruções claras
Implements automatic creation in Supabase Auth with mandatory
email confirmation. Adds credentials popup and clear messages
about the confirmation process.
BREAKING CHANGE: Users must confirm email before login
- Fix doctorId type to accept string | number | null to handle UUID values
- Remove Number() conversion that was causing NaN errors on edit
- Add debug console logs to track data loading process
- Improve error handling in useEffect for doctor and attachments loading
- Ensure form fields are properly populated with doctor data when editing