Files
task-stream/libs/web/identity/application
Josep Piguillem cbaad17fc7 fix(auth): separate Pireon clients for authorization code and password
Pireon OAuth clients allow a single grant type. With one PIREON_CLIENT_ID of
type password, email + password worked but "Sign in with Pireon" failed with
`unauthorized_client`.

- PIREON_CLIENT_ID/SECRET: authorization_code client (Sign in with Pireon,
  Swagger UI). New PIREON_PASSWORD_CLIENT_ID/SECRET: password client, falling
  back to the former so existing setups keep working.
- Refresh tries both clients: a refresh token only works with its issuer.
- PIREON_PASSWORD_GRANT=false now also rejects password grants in the API
  (before it only hid the form).
- /api/auth/config returns clientId: null when there is no authorization_code
  client, and the web hides "Sign in with Pireon".
- docker-compose passes the new variables; docs 05/07, .env.example,
  openapi.json; unit tests for the client selection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:41:50 +02:00
..
2026-10-03 13:40:26 +02:00
2026-10-03 13:40:26 +02:00
2026-10-03 13:40:26 +02:00
2026-10-03 13:40:26 +02:00
2026-10-03 13:40:26 +02:00
2026-10-03 13:40:26 +02:00
2026-10-03 13:40:26 +02:00

web-identity-application

Estado de autenticación (NgRx Signals con eventos) detrás de una facade.

  • Import: @task-stream/web/identity/application
  • Capa: application · Tags: scope:web-identity, type:application

Contenido

  • AuthFacade (lo único que se exporta, junto al tipo AuthStatus): sesión y usuario como señales; signInWith*(), completeSignIn(), signOut(), validAccessToken().
  • Interno: AuthStore (login con PKCE o email y contraseña de Pireon; restaura la sesión al arrancar y renueva el token) y eventos authPageEvents, authApiEvents, sessionEvents.

Comandos

npx nx lint web-identity-application
npx nx test web-identity-application    # Vitest

Reglas de dependencia entre capas: Arquitectura.