Next.js Made forbidden() Stable, and My try/catch Turned a 403 Into a Blank Page
Next.js 16.4.6 moved forbidden() and unauthorized() out of experimental, so you can delete the authInterrupts flag. Both work by throwing, which means a defensive try/catch in your data layer swallows the 403 and ships an empty state with a 200 status instead. Here is how the interrupt travels, where it dies, and why auth checks still cannot live inside a use cache function.

Next.js 16.4.6 shipped earlier this month and moved two functions out of experimental: forbidden() and unauthorized(). If you had experimental.authInterrupts sitting in your config since they first appeared, you can delete that line now. The same backport also stopped eslint-config-next from fighting ESLint 10, which is its own small mercy.
I turned the flag off in a multi tenant dashboard, felt good about it for about an hour, then found a page that was quietly serving a 200 to people who had no business seeing it. The API is fine. The way it works is what bit me.
What the two functions actually give you
They are route level interrupts. You call one from a server component, a route handler, or a server action, and Next stops rendering that subtree and renders the nearest forbidden.tsx or unauthorized.tsx instead.
// app/t/[tenant]/billing/page.tsx
import { forbidden, unauthorized } from 'next/navigation'
import { getSession } from '@/lib/session'
export default async function Page({ params }) {
const { tenant } = await params
const session = await getSession()
if (!session) unauthorized()
if (!session.memberships.includes(tenant)) forbidden()
return <Billing tenant={tenant} />
}// app/t/[tenant]/forbidden.tsx
export default function Forbidden() {
return <p>You are not a member of this workspace.</p>
}That is the whole contract. unauthorized() means you have no idea who this is, forbidden() means you know exactly who this is and the answer is no. One sets 401, the other 403. Nice to finally have the distinction in the framework instead of in a homegrown <AccessDenied /> component that every team writes slightly differently.
The part nobody reads: it works by throwing
forbidden() does not return. It throws a tagged error that Next recognises at the route boundary, the same trick behind notFound() and redirect(). Which means anything that catches errors between your check and the boundary owns that throw now.
Here is the code that burned me. A perfectly reasonable loader, written months before any of this existed, with a catch block added during an incident so a flaky database would degrade instead of 500.
export async function loadBilling(tenant: string) {
try {
const session = await getSession()
if (!session?.memberships.includes(tenant)) forbidden()
return await db.billing.find(tenant)
} catch (err) {
console.error('billing load failed', err)
return null // the 403 just became an empty state
}
}The page renders. Status 200. The user sees "No invoices yet" for a workspace they do not belong to. No error in Sentry, because we logged and moved on.
The fix is one import. unstable_rethrow checks whether the error is a framework interrupt and rethrows it if so, letting your real error handling keep the rest.
import { forbidden, unstable_rethrow } from 'next/navigation'
export async function loadBilling(tenant: string) {
try {
const session = await getSession()
if (!session?.memberships.includes(tenant)) forbidden()
return await db.billing.find(tenant)
} catch (err) {
unstable_rethrow(err)
console.error('billing load failed', err)
return null
}
}Yes, the stable authorization API is guarded by a function still named unstable_. I laughed too. Put it as the first statement in every catch block that sits anywhere near a server component, and treat a catch without it as a code review blocker. I added a grep to CI, which is crude and has already caught two cases.
Auth checks and use cache do not mix
The other thing I had to go unwind. If your check lives inside a function marked use cache, you have moved a per user decision into something shared by key. Next's November 3 security release fixed a batch of Cache Components issues, and the one rated High involved a public cached function reading a root parameter such as a tenant id. That is the same shape of mistake, just on their side of the line rather than yours.
The check belongs above the cache, in the uncached part of the tree, every request. Cache the expensive query if you want. Never cache the answer to "may this person see it".
Middleware is the other place people reach for, and the interrupts do not live there either. Middleware deals in responses, not render trees, so it has no boundary to hand the throw to. Coarse redirects for signed out visitors still belong there. Anything that needs to know what a specific person is a member of belongs next to the data.
Was it worth upgrading for
For the flag removal alone, no. The reason to care is that forbidden() makes a denial a first class render outcome instead of a boolean your component has to remember to check, and you get a real status code without hand rolling it. Pair it with 401 for unknown visitors and the semantics finally match what your API already returns.
Just go read your catch blocks first. Mine had been lying to me for weeks, and the only reason I noticed was that an empty invoices page looked a little too clean for an account that should not have loaded at all.
Release notes are at the Next.js GitHub releases page, and the function docs live under forbidden() and unstable_rethrow. Worth confirming the exact patch number against the releases page, since the aggregators disagree by a digit.