Class EnsureBearerToken

This service gives you a middleware that verifies if a request has an Authorization header with a bearer token; if it does, the token will be saved on the res.locals, otherwise, it will generate an error.

This is a "service middleware" to allow certain flexibility: you can have controllers where some routes are protected and others are not. For those cases, you get the service from the container, and include it only in the routes that need it.

Constructors

Properties

Accessors

Methods

Constructors

Properties

_HTTPError: typeof HTTPError

To generate the errors when the validation fails.

The customization options for the service.

Accessors

Methods