Skip to content

Commit 5e97e1a

Browse files
GreenStageEduardo Gomesmattzcarey
authored
Add invalid_target oauth error (rfc 8707) (#1183)
Co-authored-by: Eduardo Gomes <[email protected]> Co-authored-by: Matt <[email protected]>
1 parent 42a2f41 commit 5e97e1a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/server/auth/errors.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,14 @@ export class InsufficientScopeError extends OAuthError {
163163
static errorCode = 'insufficient_scope';
164164
}
165165

166+
/**
167+
* Invalid target error - The requested resource is invalid, missing, unknown, or malformed.
168+
* (Custom error for resource indicators - RFC 8707)
169+
*/
170+
export class InvalidTargetError extends OAuthError {
171+
static errorCode = 'invalid_target';
172+
}
173+
166174
/**
167175
* A utility class for defining one-off error codes
168176
*/
@@ -199,5 +207,6 @@ export const OAUTH_ERRORS = {
199207
[MethodNotAllowedError.errorCode]: MethodNotAllowedError,
200208
[TooManyRequestsError.errorCode]: TooManyRequestsError,
201209
[InvalidClientMetadataError.errorCode]: InvalidClientMetadataError,
202-
[InsufficientScopeError.errorCode]: InsufficientScopeError
210+
[InsufficientScopeError.errorCode]: InsufficientScopeError,
211+
[InvalidTargetError.errorCode]: InvalidTargetError
203212
} as const;

0 commit comments

Comments
 (0)