Interface IAuthorizeOptions

Options for an 'authorize' decorator or prop.

interface IAuthorizeOptions {
    findAuthorizedUser?: Nilable<AuthorizedUserProvider>;
    onValidationFailed?: Nilable<AuthorizeValidationFailedHandler>;
    roles?: Nilable<AuthorizeRolesValue>;
    setupMiddleware?: Nilable<SetupAuthorizeMiddlewareHandler>;
    use?: Nilable<HttpMiddleware[]>;
    validator?: Nilable<AuthorizeValidatorValue>;
}

Properties

findAuthorizedUser?: Nilable<AuthorizedUserProvider>

A function, which tries to find a user for the current request.

onValidationFailed?: Nilable<AuthorizeValidationFailedHandler>

Is invoked, when validationf failes.

roles?: Nilable<AuthorizeRolesValue>

The available roles to use, or the function that provide it.

setupMiddleware?: Nilable<SetupAuthorizeMiddlewareHandler>

A custom function to setup an 'authorize' middleware.

use?: Nilable<HttpMiddleware[]>

A list of custom middlewares to add BEFORE the authorize middleware.

validator?: Nilable<AuthorizeValidatorValue>

The custom validator to use.

Generated using TypeDoc