Skip to main content

UnregisteredAuthorizationStrategyError

@quik/authorization


@quik/authorization / UnregisteredAuthorizationStrategyError

Class: UnregisteredAuthorizationStrategyError

Defined in: authorization/src/errors/UnregisteredAuthorizationStrategyError.ts:28

Error thrown when a referenced authorization strategy has not been registered.

This error occurs when an endpoint or route attempts to use a security scheme that hasn't been properly registered with the StrategiesStore. It indicates a configuration issue where the code is referencing a security strategy that doesn't exist or hasn't been initialized.

Example

// This will throw if "oauth2" strategy hasn't been registered
const SecuredEndpoint = AuthorizationDecoratorsUtils.EndpointMiddleware(
"oauth2",
HttpDecorators.Get("/secure")
);

// To fix, register the strategy first
SchemesStore.add("oauth2", {
type: SecuritySchemeType.OAUTH2,
flows: { ... }
});

See

StrategiesStore For registering authorization strategies

Extends

  • QTranslatableError

Constructors

Constructor

new UnregisteredAuthorizationStrategyError(): UnregisteredAuthorizationStrategyError

Defined in: authorization/src/errors/UnregisteredAuthorizationStrategyError.ts:29

Returns

UnregisteredAuthorizationStrategyError

Overrides

QTranslatableError.constructor

Properties

code

code: number

Defined in: core/src/errors/QError.ts:8

The code of the error.

Inherited from

QTranslatableError.code


parameters

parameters: Record<string, any> = {}

Defined in: core/src/errors/QError.ts:12

The additional features sent to the exception.

Inherited from

QTranslatableError.parameters

Accessors

translated

Get Signature

get translated(): string

Defined in: core/src/errors/QTranslatableError.ts:12

Returns

string

Inherited from

QTranslatableError.translated

Methods

toObject()

toObject(): object

Defined in: core/src/errors/QError.ts:45

Returns

object

code

code: number

message

message: string

parameters

parameters: Record<string, any>

stack

stack: string

translated

translated: string

Inherited from

QTranslatableError.toObject


withContext()

withContext(context): this

Defined in: core/src/errors/QError.ts:26

Attach context metadata to the error parameters.

Parameters

context

Record<string, unknown>

Context data to attach.

Returns

this

Inherited from

QTranslatableError.withContext