forbidden.js
Le fichier forbidden est utilisé pour afficher l'interface utilisateur lorsque la fonction forbidden
est appelée pendant l'authentification. En plus de vous permettre de personnaliser l'interface, Next.js renverra un code d'état 403
.
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>
)
}
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>
)
}
Référence
Props
Les composants forbidden.js
n'acceptent aucune prop.
Historique des versions
Version | Changements |
---|---|
v15.1.0 | Introduction de forbidden.js . |