Skip to content

fix(nextjs): Include resource_name in protected resource - #10921

Merged
thiskevinwang merged 1 commit into
mainfrom
kevin/poppy-oauth-resource-name
Nov 19, 2026
Merged

thiskevinwang merged 1 commit into
mainfrom
kevin/poppy-oauth-resource-name

Conversation

@thiskevinwang

Copy link
Copy Markdown
Member

Description

When POPPY discovery is enabled, /.well-known/oauth-protected-resource includes the application display name as resource_name. The SDK uses organization.name from the POPPY artifact and omits the field when the name is blank or missing. RFC 9728 §2

Related clerk/clerk#3877.

Checklist

  • pnpm test runs as expected for @clerk/nextjs.
  • pnpm build runs as expected for @clerk/nextjs and its workspace dependencies.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Nov 19, 2026 4:29pm UTC
mosaic-docs Ready Ready Preview Nov 19, 2026 4:29pm UTC
swingset Ready Ready Preview Nov 19, 2026 4:29pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8d7ce7d

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

This PR includes changesets to release 2 packages
Name Type
@clerk/nextjs Patch
@clerk/swingset 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

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The OAuth protected-resource metadata response now includes resource_name when the organization name exists and is non-empty after trimming. The response omits the field when the name is missing or contains only whitespace. The existing resource URL remains based on organization.domain. Tests cover these cases, and a patch changeset documents the update.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: brkalow, dstaley

Merge Risk: Minimal · up to 8d7ce

This adds an optional resource_name to OAuth protected-resource metadata and omits it when the name is blank or missing. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description check Passed The description states that /.well-known/oauth-protected-resource now includes the application display name as resource_name when POPPY discovery is enabled. It also says the SDK uses organization.nam…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title names the fix (adding resource_name to the protected resource metadata in @clerk/nextjs), which matches the changeset, middleware change, and tests. It is specific and conventional. It omi…
Full details: Description check

Explanation

The description states that /.well-known/oauth-protected-resource now includes the application display name as resource_name when POPPY discovery is enabled. It also says the SDK uses organization.name and omits the field when the name is blank or missing. This matches the code and test changes.

Full details: Title check

Explanation

The title names the fix (adding resource_name to the protected resource metadata in @clerk/nextjs), which matches the changeset, middleware change, and tests. It is specific and conventional. It omits the POPPY context, but it still states the primary change.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Linked repositories: Some configured repositories could not be included in this review. Cross-repository analysis may be incomplete. Please check linked-repository access and settings.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between fa62aa7 and 8d7ce7d.

Files selected for processing: 3

  • .changeset/poppy-resource-name.md
  • packages/nextjs/src/server/__tests__/clerkMiddleware.test.ts
  • packages/nextjs/src/server/clerkMiddleware.ts
Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. 7 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour.

@blacksmith-sh

blacksmith-sh Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Matches resource_name in protected resource metadata

Before, the endpoint never had resource_name. After, it shows the organization name, and leaves the field out when the name is blank or missing.

Merge-base

Named organization

This PR 8d7ce7d2

Named organization

Blank and missing

Proof on 8d7ce7d2 · mocked: Clerk Backend API (A local stub serves /v1/artifacts/well-known-poppy so the organization name can...) · Did Proof get it right? Yes · No

View full Proof report · React 👎 or comment @codesmith dismiss this proof to dismiss

@thiskevinwang thiskevinwang changed the title fix(nextjs): add the POPPY protected resource name fix(nextjs): Include resource_name in protected resource Nov 19, 2026
@pkg-pr-new

pkg-pr-new Bot commented Nov 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@10921

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@10921

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@10921

@clerk/expo

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

@clerk/expo-biometrics

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

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@10921

@clerk/expo-native-components

npm i https://pkg.pr.new/@clerk/expo-native-components@10921

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@10921

@clerk/localizations

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

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@10921

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@10921

@clerk/upgrade

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

@clerk/vue

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

commit: 8d7ce7d

@github-actions

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-11-19T16:34:00.541Z

Summary

Metric Count
Packages analyzed 20
Packages with changes 0
🔴 Breaking changes 0
🟡 Non-breaking changes 0
🟢 Additions 0

No API Changes Detected

All packages have stable APIs with no detected changes.


Report generated by Break Check

Last ran on 8d7ce7d.

@thiskevinwang
thiskevinwang enabled auto-merge (squash) November 19, 2026 16:45
@thiskevinwang thiskevinwang changed the title fix(nextjs): Include resource_name in protected resource fix(nextjs): Include resource_name in protected resource Nov 19, 2026
@thiskevinwang
thiskevinwang merged commit 52a52a0 into main Nov 19, 2026
64 of 65 checks passed
@thiskevinwang
thiskevinwang deleted the kevin/poppy-oauth-resource-name branch November 19, 2026 16:46

This branch was successfully deployed

2 active deployments
Preview – swingset — 8d7ce7d2 Deployed Nov 19, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 8d7ce7d2 Deployed Nov 19, 2026 by vercel[bot]
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