Add invalid_target oauth error (rfc 8707) (#1183)
Co-authored-by: Eduardo Gomes <egomes@cloudflare.com> Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com>
This commit is contained in:
parent
42a2f41f77
commit
5e97e1a479
1 changed files with 10 additions and 1 deletions
|
|
@ -163,6 +163,14 @@ export class InsufficientScopeError extends OAuthError {
|
|||
static errorCode = 'insufficient_scope';
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalid target error - The requested resource is invalid, missing, unknown, or malformed.
|
||||
* (Custom error for resource indicators - RFC 8707)
|
||||
*/
|
||||
export class InvalidTargetError extends OAuthError {
|
||||
static errorCode = 'invalid_target';
|
||||
}
|
||||
|
||||
/**
|
||||
* A utility class for defining one-off error codes
|
||||
*/
|
||||
|
|
@ -199,5 +207,6 @@ export const OAUTH_ERRORS = {
|
|||
[MethodNotAllowedError.errorCode]: MethodNotAllowedError,
|
||||
[TooManyRequestsError.errorCode]: TooManyRequestsError,
|
||||
[InvalidClientMetadataError.errorCode]: InvalidClientMetadataError,
|
||||
[InsufficientScopeError.errorCode]: InsufficientScopeError
|
||||
[InsufficientScopeError.errorCode]: InsufficientScopeError,
|
||||
[InvalidTargetError.errorCode]: InvalidTargetError
|
||||
} as const;
|
||||
|
|
|
|||
Loading…
Reference in a new issue