Returns a response with a status code 403 (Forbidden) and instructs the router to show a 403 page.
The forbidden()
function is used in the router()
, beforeRouter()
,
and afterRouter()
hooks to indicate that the requested page
is forbidden. Optionally, you can pass a message that otherwise defaults to
'Forbidden'.
function forbidden(message: string): Promise<WixRouterResponse>;
The message to show.
import { forbidden } from "wix-router";
export function myRouter_Router(request) {
return forbidden();
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.