Skip to content

chore(deps): upgrade @clerk/nextjs to v7 (Clerk Core 3) - #434

Closed
jayypatel18 wants to merge 1 commit into
Darshan3690:mainfrom
jayypatel18:migrate-clerk-core3
Closed

jayypatel18 wants to merge 1 commit into
Darshan3690:mainfrom
jayypatel18:migrate-clerk-core3

Conversation

@jayypatel18

@jayypatel18 jayypatel18 commented Oct 3, 2026 •

Copy link
Copy Markdown

What does this PR do?

Moves the app from @clerk/nextjs 6 (Clerk Core 2) to 7 (Clerk Core 3).

  • package.json, package-lock.json: @clerk/nextjs ^6.36.5 to ^7.9.10.
  • app/components/Navbar.tsx, app/layout.tsx: <SignedIn> and <SignedOut> are gone in Core 3. They become <Show when="signed-in"> and <Show when="signed-out">, and the imports follow. app/layout.tsx only imported them, so only its import changes.
  • app/components/Navbar.tsx, app/dashboard/layout.tsx: <UserButton> no longer takes afterSignOutUrl. It was set to "/", which is also where Clerk sends a signed-out user when nothing else is configured, so sign-out still lands on the home page.
  • app/(auth)/sign-in/[[...sign-in]]/page.tsx: the layout key of appearance is now options. Values unchanged.

Motivation

Clerk's schedule ends long term support for Core 2 in January 2027.

How to test

What I ran, in a clean Node 20 container with install scripts off, on main (40db36c) and then on this branch:

Step main this branch
npm ci ok ok
npm test 25 passed, 1 failed 25 passed, 1 failed
tsc --noEmit 54 errors the same 54 errors
npm run lint ok ok

The failing test is the same one on both sides: __tests__/app/home.support-section.test.tsx ("uses stronger dark-mode contrast and visible focus rings in the help cards"). The 54 type errors are on main too; none is new.

Not checked: npm run build did not pass on main in the container either (it has no network and no Clerk or Supabase keys), so it was not compared. The app was not run against a Clerk instance, so no sign-in or sign-out was tried.

To check it yourself: npm install, npm run dev, then sign in, open the dashboard, and sign out from the user button. You should land on /.

Checklist

  • I followed the contributing guide, apart from running the dev server

Summary by CodeRabbit

  • Authentication
    • Navigation continues to show login or dashboard links according to sign-in status on desktop and mobile.
    • After signing out, users follow the authentication provider’s default redirect behavior instead of being explicitly sent to the homepage.
    • Updated sign-in appearance configuration; social button placement and style remain unchanged.

@vercel

vercel Bot commented Oct 3, 2026

Copy link
Copy Markdown

@jayypatel18 is attempting to deploy a commit to the Darshan Rajput's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9c74eb36-7b2a-40b7-938f-08bd5845d9dd
📥 Commits

Reviewing files that changed from the base of the PR and between 40db36c and 7ac4a6e.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • app/(auth)/sign-in/[[...sign-in]]/page.tsx
  • app/components/Navbar.tsx
  • app/dashboard/layout.tsx
  • app/layout.tsx
  • package.json
💤 Files with no reviewable changes (1)
  • app/dashboard/layout.tsx

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The Clerk dependency range changes from ^6.36.5 to ^7.9.10. The sign-in appearance configuration and authentication controls are updated, and explicit post-sign-out destinations are removed from UserButton instances.

Changes

Clerk API update

Layer / File(s) Summary
Dependency and sign-in configuration
package.json, app/(auth)/sign-in/[[...sign-in]]/page.tsx
The Clerk dependency range changes to ^7.9.10. Sign-in social button settings move from layout to options.
Authentication state controls
app/layout.tsx, app/components/Navbar.tsx, app/dashboard/layout.tsx
The Clerk import changes to Show. Desktop and mobile navigation use Show conditions for signed-in and signed-out controls. The UserButton instances no longer specify afterSignOutUrl="/".

Priority: ⬇️ Low

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

Change: Other

Merge Risk: ⚪ Minimal · up to 7ac4a

The update changes Clerk’s sign-in options and authentication controls; the documented sign-out destination remains the home page. No concrete user-facing regression is established, so the change appears ready for normal merge checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 7ac4a

The application retains its server-side authentication checks, and the inspected changes do not establish a new authorization bypass. Risk remains low rather than minimal because the upgraded provider’s exact sign-out and authentication behavior has not been validated in the deployed configuration.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — A regression in the upgraded authentication implementation could affect application sessions, protected pages, and API identity extraction rather than only navigation rendering. The inspected downstream scope includes badges, leaderboard access, and user-owned bookmark deletion; capped dependency evidence does not establish an exhaustive consumer inventory.

Trust Boundaries and Controls

  • observed — The sign-in route remains public, and inspected middleware and API enforcement source is unchanged from the base. Middleware also retains its existing dummy-key bypass intended for CI. These are pre-existing control arrangements, not evidence of a PR-introduced bypass or proof of production credential configuration.

Hardening Proposals

  • proposed — Validate the locked release with real Clerk credentials: unauthenticated requests must remain denied, completed sign-out must remove protected-route authority, and failure, interruption, repetition, concurrency, and recovery must not leave UI state mistaken for session revocation. Confirm the effective post-sign-out destination separately from successful session termination.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the @clerk/nextjs upgrade to v7 and Clerk Core 3, which is the main change.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@jayypatel18

Copy link
Copy Markdown
Author

Hi Darshan,

A gentle follow up on this PR. It upgrades your clerk package to the latest supported package before EOL (Jan, 2027) of current package.

Once you get time kindly take a look at this PR, your time is much appreciated!

Thanks,
Jay

Repository owner locked and limited conversation to collaborators Nov 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants