7 Commits

Author SHA1 Message Date
5995f2c541 feat(api): add server-side /api/create-user + client fallback (signup + edge fn)
- Adds Next.js route src/app/api/create-user/route.ts for secure creation (JWT validation, password generation).
- Adds client fallback in lib/api.ts: signup via /auth/v1/signup then call create-user Edge Function.
- Wires CredentialsDialog into registration forms and maps RLS errors to a user-friendly message.
- Removes banner from pp/paciente/page.tsx.

NOTE: Not fully resolved — requires SUPABASE_SERVICE_ROLE_KEY on server and/or RLS policy changes; server route needs Next.js restart.
2025-10-14 20:05:23 -03:00
fb578b2a7a feat(api): add server-side /api/create-user route (user creation not functional yet)
- What was done:
  - Added a server-side Next.js route at `src/app/api/create-user/route.ts` that validates the requester token, checks roles, generates a temporary password and forwards the creation to the Supabase Edge Function using the service role key.
  - Client wired to call the route via `lib/config.ts` (`FUNCTIONS_ENDPOINTS.CREATE_USER` -> `/api/create-user`) and the `criarUsuario()` wrapper in `lib/api.ts`.
- Status / missing work:
  - Important: user creation is NOT working yet (requests to `/api/create-user` return 404 in dev).
  - Next steps: restart dev server, ensure `SUPABASE_SERVICE_ROLE_KEY` is set in the environment, check server logs and run a test POST with a valid admin JWT.
2025-10-14 17:02:26 -03:00
1de9176e94 feat: adicionar página de resultados de busca ao clicar em pesquisar 2025-10-09 14:15:08 -03:00
b6c160bffd fix: hover azul no botão Ver consultas agendadas 2025-10-09 11:52:42 -03:00
João Gustavo
0a7d3f3ae4 fix-laudos-module 2025-10-07 02:56:13 -03:00
João Gustavo
a43fdcc655 add-patient-page 2025-10-07 02:35:49 -03:00
João Gustavo
a6ae27876e add-login-and-logout-endpoints 2025-09-28 04:10:40 -03:00