authInterrupts
authInterrupts設定オプションを使用すると、アプリケーションでforbiddenおよびunauthorized APIを使用できるようになります。これらの関数は実験的なものであるため、使用するにはnext.config.jsファイルでauthInterruptsオプションを有効にする必要があります:
next.config.ts
TypeScript
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
experimental: {
authInterrupts: true,
},
}
export default nextConfig