Deprecate middleware auth gating across Next.js reference and guides#3405
Open
jacekradko wants to merge 1 commit into
Open
Conversation
Wraps the auth-gating sections of the Next.js clerkMiddleware reference with the deprecation notice (keeping anchors and clerkMiddleware config intact), redirects token-type gating to auth({ acceptsToken }) at the route, and points readers to resource-level protection. Updates the guides that taught the pattern: basic-rbac now leads with page-level checks, session-tasks elevates <RedirectToTasks />, geo-blocking and satellite-domains keep their middleware but drop the auth tail, the custom sign-in/up steps are framed as legacy, CSP examples drop the irrelevant auth gating, and the MCP guide no longer special-cases .well-known. All surviving createRouteMatcher examples use the newline-safe :path* form instead of (.*).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #3404. Applies the deprecation across the Next.js reference and the guides that taught middleware gating.
The reference page is kept-but-wrapped: each auth-gating section keeps its existing anchor but gains the deprecation notice, token-type gating now points to
auth({ acceptsToken })at the route, and the Combine-Middleware example loses itsauth.protect()line. In the guides,basic-rbacnow leads with the page-level check,session-taskselevates<RedirectToTasks />,geo-blockingandsatellite-domainskeep their middleware but drop the auth tail, the custom sign-in/up steps are framed as legacy, the CSP examples drop the auth gating that was never relevant to CSP, and the MCP guide stops special-casing.well-known.Load-bearing bit to scrutinize: every surviving
createRouteMatcherexample moves from/foo(.*)to/foo/:path*. The(.*)form misses encoded newlines (a bypass) and over-matches/foobar;/:path*fixes both. Verified against the SDK's path-to-regexp.