@donation-alerts/auth
Version:
Authentication provider for Donation Alerts API with ability to automatically refresh user tokens.
29 lines (28 loc) • 772 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MissingScopeError = void 0;
const common_1 = require("@donation-alerts/common");
/**
* An error indicating that a token does not include the requested scope.
*/
class MissingScopeError extends common_1.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;
}
}
exports.MissingScopeError = MissingScopeError;