rembrembdocs

authInterrupts

This feature is currently available in the canary channel and subject to change. Try it out by upgrading Next.js, and share your feedback on GitHub.

Last updated April 23, 2026

The authInterrupts configuration option allows you to use forbidden and unauthorized APIs in your application. While these functions are experimental, you must enable the authInterrupts option in your next.config.js file to use them:

next.config.ts

JavaScriptTypeScript

import type { NextConfig } from 'next'
 
const nextConfig: NextConfig = {
  experimental: {
    authInterrupts: true,
  },
}
 
export default nextConfig

[

forbidden

API Reference for the forbidden function.

](../../../functions/forbidden/index.md)[

unauthorized

API Reference for the unauthorized function.

](../../../functions/unauthorized/index.md)[

forbidden.js

API reference for the forbidden.js special file.

](../../../file-conventions/forbidden/index.md)[

unauthorized.js

API reference for the unauthorized.js special file.

](../../../file-conventions/unauthorized/index.md)

Was this helpful?