Skip to content

Conversation

Ben2W
Copy link
Contributor

@Ben2W Ben2W commented Sep 30, 2025

Our oauth applications feature has a /oauth/end_session endpoint.

In order for this endpoint to work, we need to know about the clerk client. In development we need to grab the dev browser (even if logged out).

Summary by CodeRabbit

  • Bug Fixes
    • Seamless sign-out redirects: OIDC end-session callbacks are now recognized as valid redirects, preventing unnecessary prompts.
    • Improved logout compatibility: Users are reliably returned to the app after signing out with identity providers.
    • More robust frontend redirect flows: Logout callbacks included in allowed paths to reduce edge-case failures during sign-out.

Copy link

changeset-bot bot commented Sep 30, 2025

🦋 Changeset detected

Latest commit: 736bb8e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Minor
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Sep 30, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Sep 30, 2025 0:58am

Copy link
Contributor

coderabbitai bot commented Sep 30, 2025

Walkthrough

Adds the OIDC logout path /oauth/end_session to the frontend API redirect paths recognized by isRedirectForFAPIInitiatedFlow and updates tests and a changeset; no other runtime logic or exported APIs were changed.

Changes

Cohort / File(s) Summary
URL utils
packages/clerk-js/src/utils/url.ts
Added '/oauth/end_session' to the frontendApiRedirectPathsNoUserInput allowlist used by isRedirectForFAPIInitiatedFlow.
Tests
packages/clerk-js/src/utils/__tests__/url.spec.ts
Added test cases asserting that https://clerk.foo.bar-53.lcl.dev/oauth/end_session is treated as an FAPI-initiated redirect (true) and does not require user input (false).
Changeset / Metadata
.changeset/gold-geckos-fix.md
Bumped package metadata and recorded the frontend redirect-path addition (changeset references /oauth/.../end_session).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant IdP as Identity Provider
  participant Browser
  participant App
  participant URLUtil as url.ts (isRedirectForFAPIInitiatedFlow)

  IdP->>Browser: Redirect to frontend API path (e.g. /oauth/end_session)
  Browser->>App: Load redirect URL
  App->>URLUtil: Check if URL is FAPI-initiated redirect
  URLUtil-->>App: true if path matches allowlist (includes /oauth/end_session)
  App-->>Browser: Proceed with post-redirect handling
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5–15 minutes

Poem

I hop through code where endpoints lie,
A tiny path let logout fly.
End_session hops into the list,
A carrot-sized tweak—too sweet to resist. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Title Check ✅ Passed The title succinctly follows conventional commit style and clearly describes the primary change—adding OIDC logout support to the frontendApiRedirectPathsNoUserInput configuration—without extraneous detail or vague language. It directly reflects the core modification introduced in the pull request and allows teammates to understand the intent at a glance.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ben/adding-oidc-logout-toredirect-list

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

Copy link

pkg-pr-new bot commented Sep 30, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@6890

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@6890

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@6890

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@6890

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@6890

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@6890

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@6890

@clerk/clerk-expo

npm i https://pkg.pr.new/@clerk/clerk-expo@6890

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@6890

@clerk/express

npm i https://pkg.pr.new/@clerk/express@6890

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@6890

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@6890

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@6890

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@6890

@clerk/clerk-react

npm i https://pkg.pr.new/@clerk/clerk-react@6890

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@6890

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@6890

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@6890

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@6890

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@6890

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@6890

@clerk/types

npm i https://pkg.pr.new/@clerk/types@6890

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@6890

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@6890

commit: 736bb8e

@Ben2W Ben2W changed the title adding oidc logout to frontendApiRedirectPathsNoUserInput feat(clerk-js): Adding oidc logout to frontendApiRedirectPathsNoUserInput Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants