Search.../

forbidden( )

Returns a response with a status code 403 (Forbidden) and instructs the router to show a 403 page.

Description

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'.

Authorization

Request

This endpoint does not take any parameters

Response Object

Fulfilled - A response object with HTTP status code 403.

Returns an empty object.

Status/Error Codes

Was this helpful?

Create a forbidden response

Copy Code
1import {forbidden} from 'wix-router';
2
3export function myRouter_Router(request) {
4
5 return forbidden();
6}