Skip to content

fix: RWA gaps — optional appBaseUrl and session hooks - #11

Merged
yogeshchoudhary147 merged 4 commits into
mainfrom
fix/rwa-gaps
Aug 20, 2026
Merged

fix: RWA gaps — optional appBaseUrl and session hooks#11
yogeshchoudhary147 merged 4 commits into
mainfrom
fix/rwa-gaps

Conversation

@yogeshchoudhary147

Copy link
Copy Markdown
Contributor

Summary

  • AUTH0_APP_BASE_URL is now optional. When not set, the app base URL is inferred from the incoming request origin. Production deployments behind a reverse proxy should still set it explicitly.
  • Added beforeSessionSaved hook to Auth0Server. Called before the session is encrypted into the cookie — use it to transform the session (e.g. strip OIDC metadata claims with stripIdTokenClaims to reduce cookie size).
  • Added onCallback hook to Auth0Server. Called after a successful authentication callback with the full Auth0Session — use it to provision users in your own database on first login.

Test plan

  • All 333 existing tests pass
  • AUTH0_APP_BASE_URL omitted locally — login and logout work, redirect_uri inferred from request
  • AUTH0_APP_BASE_URL set explicitly — behaviour unchanged
  • beforeSessionSaved strips claims before session is written to cookie
  • onCallback fires after successful login with the correct session

Comment thread src/server/handlers.ts Outdated
Comment thread src/server/auth0-server.ts Outdated
Comment thread src/server/auth0-server.ts
@yogeshchoudhary147
yogeshchoudhary147 merged commit 4f3ca5f into main Aug 20, 2026
4 checks passed
@yogeshchoudhary147
yogeshchoudhary147 deleted the fix/rwa-gaps branch August 20, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants