Phase 1: Critical Backend Fixes #412

Closed
opened 2026-02-16 16:56:37 +00:00 by jason.woltje · 0 comments
Owner

Parent Epic: #411

Stories

  • 1.1 Add OIDC_REDIRECT_URI to REQUIRED_OIDC_ENV_VARS with URL + path validation
  • 1.2 Wrap BetterAuth handler in try/catch with error logging
  • 1.3 Fix docker-compose.swarm.portainer.yml OIDC_REDIRECT_URI default
  • 1.4 Enable PKCE in genericOAuth config
  • 1.5 Add inline docs above @SkipCsrf() explaining BetterAuth's internal CSRF handling

Acceptance Criteria

  • OIDC_REDIRECT_URI validated (URL format, /auth/callback path)
  • BetterAuth errors logged with context (method, URL, stack)
  • Docker compose has safe default for OIDC_REDIRECT_URI
  • PKCE enabled - authorization URL includes code_challenge
  • @SkipCsrf() documented with rationale
  • All new code has tests (85%+ coverage)
  • pnpm lint && pnpm typecheck && pnpm test pass

Files

  • apps/api/src/auth/auth.config.ts
  • apps/api/src/auth/auth.controller.ts
  • apps/api/src/auth/auth.config.spec.ts
  • docker-compose.swarm.portainer.yml
## Parent Epic: #411 ## Stories - **1.1** Add OIDC_REDIRECT_URI to REQUIRED_OIDC_ENV_VARS with URL + path validation - **1.2** Wrap BetterAuth handler in try/catch with error logging - **1.3** Fix docker-compose.swarm.portainer.yml OIDC_REDIRECT_URI default - **1.4** Enable PKCE in genericOAuth config - **1.5** Add inline docs above @SkipCsrf() explaining BetterAuth's internal CSRF handling ## Acceptance Criteria - [ ] OIDC_REDIRECT_URI validated (URL format, /auth/callback path) - [ ] BetterAuth errors logged with context (method, URL, stack) - [ ] Docker compose has safe default for OIDC_REDIRECT_URI - [ ] PKCE enabled - authorization URL includes code_challenge - [ ] @SkipCsrf() documented with rationale - [ ] All new code has tests (85%+ coverage) - [ ] pnpm lint && pnpm typecheck && pnpm test pass ## Files - apps/api/src/auth/auth.config.ts - apps/api/src/auth/auth.controller.ts - apps/api/src/auth/auth.config.spec.ts - docker-compose.swarm.portainer.yml
jason.woltje added this to the Auth-Frontend-Remediation (0.0.14) milestone 2026-02-16 16:56:37 +00:00
jason.woltje added the authsecurityapiapi labels 2026-02-16 16:56:37 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaic/stack#412