@atproto/oauth-scopes
Version:
A library for manipulating and validating ATproto OAuth scopes in TypeScript.
16 lines (13 loc) • 381 B
text/typescript
export class ScopeMissingError extends Error {
name = 'ScopeMissingError'
// compatibility layer with http-errors package. The goal if to make
// isHttpError(new ScopeMissingError) return true.
status = 403
expose = true
get statusCode() {
return this.status
}
constructor(public readonly scope: string) {
super(`Missing required scope "${scope}"`)
}
}