Skip to content

feat(auth0-server-js): add revokeRefreshToken and logout revocation support - #218

Closed
jd3vi1 wants to merge 1 commit into
mainfrom
feat/server-js-revoke-token
Closed

feat(auth0-server-js): add revokeRefreshToken and logout revocation support#218
jd3vi1 wants to merge 1 commit into
mainfrom
feat/server-js-revoke-token

Conversation

@jd3vi1

@jd3vi1 jd3vi1 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds ServerClient.revokeRefreshToken() — reads the refresh token from the session and delegates to AuthClient.revokeToken(), wrapping errors in TokenRevocationError
  • logout() now always attempts revocation best-effort before clearing the session; revocation failure never blocks logout
  • In resolver mode, both revocation and session deletion are gated by a domain-match guard (session domain must match resolved domain)
  • Re-exports TokenRevocationError from the server-js public surface
  • Adds /auth/revoke route to the Express example app
  • Documents revocation behavior in EXAMPLES.md

Depends on

Requires auth0-auth-js#217 to be merged and released first (revokeToken() and TokenRevocationError are defined there).

Test plan

  • revokeRefreshToken — success, missing session, missing refresh token, wraps error as TokenRevocationError
  • logout (static mode) — revokes then deletes session; revocation failure does not block logout
  • logout (resolver mode) — revokes and deletes when domains match; skips both when domains differ

Closes SDK-8850 (server-js portion)

…upport (SDK-8850)

Adds ServerClient.revokeRefreshToken() which reads the refresh token
from the session and delegates to AuthClient.revokeToken(). Logout now
always attempts revocation best-effort before clearing the session. In
resolver mode, both revocation and session deletion are gated by a
domain-match guard. Exports TokenRevocationError from the public surface.
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jd3vi1, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6c778549-1817-4b59-861c-d2f27041ffbf

📥 Commits

Reviewing files that changed from the base of the PR and between 21e9777 and 59115db.

📒 Files selected for processing (7)
  • examples/example-express-web/src/auth0.ts
  • examples/example-express-web/views/private.ejs
  • packages/auth0-server-js/EXAMPLES.md
  • packages/auth0-server-js/src/index.ts
  • packages/auth0-server-js/src/server-client.spec.ts
  • packages/auth0-server-js/src/server-client.ts
  • packages/auth0-server-js/src/types.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/server-js-revoke-token

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jd3vi1 jd3vi1 closed this Jul 15, 2026
@jd3vi1
jd3vi1 deleted the feat/server-js-revoke-token branch July 15, 2026 08:48
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.

1 participant