mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Closes: https://linear.app/vercel/issue/DOC-4686/clean-up-routing-section Redirects: https://github.com/vercel/front/pull/47151 --------- Co-authored-by: Joseph <[email protected]> Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
34 lines
1.0 KiB
Plaintext
34 lines
1.0 KiB
Plaintext
---
|
|
title: authInterrupts
|
|
description: Learn how to enable the experimental `authInterrupts` configuration option to use `forbidden` and `unauthorized`.
|
|
version: canary
|
|
related:
|
|
links:
|
|
- app/api-reference/functions/forbidden
|
|
- app/api-reference/functions/unauthorized
|
|
- app/api-reference/file-conventions/forbidden
|
|
- app/api-reference/file-conventions/unauthorized
|
|
---
|
|
|
|
The `authInterrupts` configuration option allows you to use [`forbidden`](/docs/app/api-reference/functions/forbidden) and [`unauthorized`](/docs/app/api-reference/functions/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:
|
|
|
|
```ts filename="next.config.ts" switcher
|
|
import type { NextConfig } from 'next'
|
|
|
|
const nextConfig: NextConfig = {
|
|
experimental: {
|
|
authInterrupts: true,
|
|
},
|
|
}
|
|
|
|
export default nextConfig
|
|
```
|
|
|
|
```js filename="next.config.js" switcher
|
|
module.exports = {
|
|
experimental: {
|
|
authInterrupts: true,
|
|
},
|
|
}
|
|
```
|