react-code-dataset / next.js /docs /01-app /03-api-reference /05-config /01-next-config-js /authInterrupts.mdx
Download next.js/docs/01-app/03-api-reference/05-config/01-next-config-js/authInterrupts.mdx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/docs/01-app/03-api-reference/05-config/01-next-config-js/authInterrupts.mdx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/docs/01-app/03-api-reference/05-config/01-next-config-js/authInterrupts.mdx
-
curl -L -o authInterrupts.mdx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/docs/01-app/03-api-reference/05-config/01-next-config-js/authInterrupts.mdx
1.04 kB
| 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, | |
| }, | |
| } | |
| ``` | |