Skip to main content
Version: 4.x

Unauthorized

Type URIhttps://doc.expresso-ts.com/docs/errors/unauthorized
HTTP status401

The request carries no credentials, or credentials that are not valid.

When it is sent​

  • A handler, guard or middleware throws AppError.unauthorized(message?). The default message is Unauthorized.
  • Any error that carries the status 401 and is meant for the client.
{
"type": "https://doc.expresso-ts.com/docs/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "Unauthorized",
"instance": "/api/orders"
}

What to do​

Send valid credentials. For a caller that is identified but not allowed, the type is forbidden.

See Error responses for the shape of the document and how to turn it on.