@donation-alerts/auth
Version:
Authentication provider for Donation Alerts API with ability to automatically refresh user tokens.
25 lines (24 loc) • 612 B
JavaScript
import { CustomError } from '@donation-alerts/common';
/**
* An error indicating that a token does not include the requested scope.
*/
export class MissingScopeError extends CustomError {
/** @internal */
constructor(_userId, _scopes, message) {
super(message);
this._userId = _userId;
this._scopes = _scopes;
}
/**
* The ID of the user associated with the token, or `null` if user is not known.
*/
get userId() {
return this._userId;
}
/**
* The list of missing scopes.
*/
get scopes() {
return this._scopes;
}
}