fix(auth): el fallo de OAuth redirige a /login en vez de 500 - #340
Merged
Conversation
El flujo OAuth de navegador (Google/Facebook) devolvía un 500 JSON cuando la
estrategia lanzaba una excepción (p.ej. UnverifiedProviderEmailError /
AccountLinkRequiresAuthError: el email ya pertenece a otra cuenta). Se añade
OAuthExceptionFilter al OAuthController: cualquier fallo redirige a
`${FRONTEND_URL}/login?error=<code>` (account_exists | oauth_failed),
preservando la cookie `next`. Nunca más un 500 crudo a un usuario en pleno login.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
vgpastor
enabled auto-merge (squash)
July 6, 2026 10:40
This was referenced Jul 7, 2026
vgpastor
added a commit
that referenced
this pull request
Jul 7, 2026
…r 3.9.1) (#358) Sustituye a **#330**, que estaba en rojo por dos motivos ya resueltos aquí: 1. **`Test e2e` fallaba** por base desactualizada: #330 salía de un `main` anterior a #340/#347, así que `oauth-csrf.e2e-spec.ts` seguía esperando `401` en vez del `302`. Rebaseado sobre `main` actual → resuelto. 2. **`Format check`/`Lint` fallaban** por el bump `prettier 3.8.4 → 3.9.1`, que reformatea 8 ficheros de `apps/api` (solo estilo). Aplicado `prettier --write` en este PR. ## Bumps del grupo - `bullmq ^5.79.1 → ^5.79.2` (patch) - `prettier ^3.4.2 → ^3.9.1` - `react`/`react-dom 19.2.4 → 19.2.7` (patch) - `openapi-fetch ^0.13.5 → ^0.17.0` - (transitivos: `msgpackr`, `semver`, `openapi-typescript-helpers`) ## Verificación local del gate - `pnpm install` — lockfile fusionado **sin drift**. - `pnpm --filter api build` ✅ · `pnpm --filter api exec eslint --max-warnings=0` ✅ · `prettier --check` ✅ - **`pnpm --filter @reliefhub/api-client build` ✅ y `pnpm --filter web build` ✅** — el salto de `openapi-fetch 0.13 → 0.17` (potencialmente breaking en 0.x) **compila sin cambios** en el cliente tipado ni en web. - `pnpm --filter web lint` ✅ · `pnpm --filter web test` 118/118 ✅ - Suite de API (`pnpm --filter api test`) no ejecutable en local (sin Docker) → la valida CI. ## Crédito Bumps originales: Dependabot #330. --- _Generated by [Claude Code](https://claude.ai/code/session_019VvSt5e3JoUEe2VF1EUrZY)_ --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
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.
El callback de OAuth devolvía 500 JSON cuando la estrategia lanzaba una excepción de dominio (el email ya pertenece a otra cuenta →
UnverifiedProviderEmailError/AccountLinkRequiresAuthError). NuevoOAuthExceptionFilteren el OAuthController: redirige a/login?error=account_exists|oauth_failedpreservando la cookienext. Gate: build + eslint + prettier + 24 tests oauth.