You are currently viewing documentation for the canary channel of Next.js.
authInterrupts
This API is currently in the canary channel and not yet available in a stable version.
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
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
experimental: {
authInterrupts: true,
},
}
export default nextConfig
Next Steps
Introduction
...
Functions
forbidden
API Reference for the forbidden function.
Introduction
...
Functions
unauthorized
API Reference for the unauthorized function.
Introduction
...
File Conventions
forbidden.js
API reference for the forbidden.js special file.
Introduction
...
File Conventions
unauthorized.js
API reference for the unauthorized.js special file.
Was this helpful?