You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Descricao
Integra o botao "Entrar com Google" no frontend com o backend OAuth,
usando fluxo Full Redirect.
**Backend:**
- Corrigido callback OAuth para usar `req.session` (compartilhado com
middleware `withSession`) em vez de criar instancia separada de
`getIronSession`
- Callback agora salva `session.userId` e redireciona ao frontend
(`res.redirect`) em vez de retornar JSON
- Adicionada variavel de ambiente `FRONTEND_URL` para controlar o
redirect pos-OAuth
**Frontend:**
- Adicionada funcao `getGoogleAuthUrl()` no `authService.ts`
- Botao Google nas paginas de login e registro agora inicia o fluxo
OAuth ao clicar
- Criada pagina `AuthCallback` que detecta a sessao e navega para `/app`
- Adicionado `refreshUser()` no `AuthContext` para re-buscar `/auth/me`
apos redirect OAuth
**Testes:**
- Atualizados testes unitarios e de integracao do `auth.controller` para
esperar redirects (302) em vez de respostas JSON
## Linear link
https://linear.app/tatame/issue/PAV-5/login-social-google-oauth
## Como foi testado
Testes unitarios e de integracao passando (305/305). Login com Google
testado manualmente end-to-end em ambiente local com Docker.
0 commit comments