PAV-5: Login social Google (OAuth)#140
Merged
Benevanio merged 6 commits intoJun 16, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Backend: fix callback to use req.session (shared with withSession middleware) instead of creating separate getIronSession instance, save userId in session, redirect to frontend instead of returning JSON - Backend: add FRONTEND_URL env var for post-OAuth redirect - Frontend: add getGoogleAuthUrl() to authService - Frontend: wire Google button onClick in login and register pages - Frontend: create AuthCallback page that detects session and navigates to /app - Add AGENTS.md with project rules - Add design spec and implementation plan docs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AuthCallback now re-fetches /auth/me after OAuth redirect to pick up the newly created session, instead of relying on the initial mount fetch which runs before the session exists. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests now expect 302 redirects instead of JSON responses, and use req.session instead of getIronSession mock, matching the controller changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Someone is attempting to deploy a commit to the Bene Tesla's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Add getGoogleAuthUrl tests to authService tests - Add refreshUser tests to AuthContext tests - Create AuthCallback page tests (loading, redirect on success/failure) Brings branch coverage above 80% threshold. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Benevanio
added a commit
that referenced
this pull request
Jun 16, 2026
## 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Descricao
Integra o botao "Entrar com Google" no frontend com o backend OAuth, usando fluxo Full Redirect.
Backend:
req.session(compartilhado com middlewarewithSession) em vez de criar instancia separada degetIronSessionsession.userIde redireciona ao frontend (res.redirect) em vez de retornar JSONFRONTEND_URLpara controlar o redirect pos-OAuthFrontend:
getGoogleAuthUrl()noauthService.tsAuthCallbackque detecta a sessao e navega para/apprefreshUser()noAuthContextpara re-buscar/auth/meapos redirect OAuthTestes:
auth.controllerpara esperar redirects (302) em vez de respostas JSONLinear 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.