本页还没有译文
本页 7 段还没译成简体中文,下面显示的是英文原文。forbidden.js
还没翻译译自英文(nextjs.org)本页 7 段都还没译
The forbidden file is used to render UI when the forbidden function is invoked during authentication. Along with allowing you to customize the UI, Next.js will return a 403 status code.
app/forbidden.tsx
import Link from 'next/link'
export default function Forbidden() {
return (
<div>
<h2>Forbidden</h2>
<p>You are not authorized to access this resource.</p>
<Link href="/">Return Home</Link>
</div>
)
}app/forbidden.jsx
import Link from 'next/link'
export default function Forbidden() {
return (
<div>
<h2>Forbidden</h2>
<p>You are not authorized to access this resource.</p>
<Link href="/">Return Home</Link>
</div>
)
}Reference
Props
forbidden.js components do not accept any props.
Version History
| Version | Changes |
|---|---|
v15.1.0 | forbidden.js introduced. |
AI 翻译查看英文原文