AtLeastOneFlowRequiredError
@quik/authorization / AtLeastOneFlowRequiredError
Class: AtLeastOneFlowRequiredError
Defined in: authorization/src/errors/AtLeastOneFlowRequiredError.ts:34
Error thrown when an OAuth2 scheme is registered without any flows.
This error occurs when attempting to register an OAuth2 security scheme without specifying at least one OAuth2 flow (authorization code, implicit, password, or client credentials). According to the OAuth2 specification, at least one flow must be defined for a valid OAuth2 configuration.
Example
// This will throw AtLeastOneFlowRequiredError
SchemesStore.add("invalidOAuth", {
type: SecuritySchemeType.OAUTH2,
flows: {} // Empty flows object
});
// Correct way with at least one flow
SchemesStore.add("validOAuth", {
type: SecuritySchemeType.OAUTH2,
flows: {
authorizationCode: {
authorizationUrl: "https://example.com/oauth/authorize",
tokenUrl: "https://example.com/oauth/token",
scopes: { "read:data": "Read access to data" }
}
}
});
See
SchemesStore For registering security schemes
Extends
QTranslatableError
Constructors
Constructor
new AtLeastOneFlowRequiredError():
AtLeastOneFlowRequiredError
Defined in: authorization/src/errors/AtLeastOneFlowRequiredError.ts:35
Returns
AtLeastOneFlowRequiredError
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