msal
Version:
Microsoft Authentication Library for js
49 lines • 2.4 kB
JavaScript
;
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var ServerError_1 = require("./ServerError");
exports.InteractionRequiredAuthErrorMessage = {
interactionRequired: {
code: "interaction_required"
},
consentRequired: {
code: "consent_required"
},
loginRequired: {
code: "login_required"
},
};
/**
* Error thrown when the user is required to perform an interactive token request.
*/
var InteractionRequiredAuthError = /** @class */ (function (_super) {
tslib_1.__extends(InteractionRequiredAuthError, _super);
function InteractionRequiredAuthError(errorCode, errorMessage) {
var _this = _super.call(this, errorCode, errorMessage) || this;
_this.name = "InteractionRequiredAuthError";
Object.setPrototypeOf(_this, InteractionRequiredAuthError.prototype);
return _this;
}
InteractionRequiredAuthError.isInteractionRequiredError = function (errorString) {
var interactionRequiredCodes = [
exports.InteractionRequiredAuthErrorMessage.interactionRequired.code,
exports.InteractionRequiredAuthErrorMessage.consentRequired.code,
exports.InteractionRequiredAuthErrorMessage.loginRequired.code
];
return errorString && interactionRequiredCodes.indexOf(errorString) > -1;
};
InteractionRequiredAuthError.createLoginRequiredAuthError = function (errorDesc) {
return new InteractionRequiredAuthError(exports.InteractionRequiredAuthErrorMessage.loginRequired.code, errorDesc);
};
InteractionRequiredAuthError.createInteractionRequiredAuthError = function (errorDesc) {
return new InteractionRequiredAuthError(exports.InteractionRequiredAuthErrorMessage.interactionRequired.code, errorDesc);
};
InteractionRequiredAuthError.createConsentRequiredAuthError = function (errorDesc) {
return new InteractionRequiredAuthError(exports.InteractionRequiredAuthErrorMessage.consentRequired.code, errorDesc);
};
return InteractionRequiredAuthError;
}(ServerError_1.ServerError));
exports.InteractionRequiredAuthError = InteractionRequiredAuthError;
//# sourceMappingURL=InteractionRequiredAuthError.js.map