UNPKG

msal-iframe-ok

Version:

Fork to allow silent renewal in iFrame of Microsoft Authentication Library for js

56 lines 1.77 kB
"use strict"; // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. Object.defineProperty(exports, "__esModule", { value: true }); var Utils_1 = require("./Utils"); var ClientAuthError_1 = require("./error/ClientAuthError"); /** * @hidden */ var ClientInfo = /** @class */ (function () { function ClientInfo(rawClientInfo) { if (!rawClientInfo || Utils_1.Utils.isEmpty(rawClientInfo)) { this.uid = ""; this.utid = ""; return; } try { var decodedClientInfo = Utils_1.Utils.base64DecodeStringUrlSafe(rawClientInfo); var clientInfo = JSON.parse(decodedClientInfo); if (clientInfo) { if (clientInfo.hasOwnProperty("uid")) { this.uid = clientInfo.uid; } if (clientInfo.hasOwnProperty("utid")) { this.utid = clientInfo.utid; } } } catch (e) { throw ClientAuthError_1.ClientAuthError.createClientInfoDecodingError(e); } } Object.defineProperty(ClientInfo.prototype, "uid", { get: function () { return this._uid ? this._uid : ""; }, set: function (uid) { this._uid = uid; }, enumerable: true, configurable: true }); Object.defineProperty(ClientInfo.prototype, "utid", { get: function () { return this._utid ? this._utid : ""; }, set: function (utid) { this._utid = utid; }, enumerable: true, configurable: true }); return ClientInfo; }()); exports.ClientInfo = ClientInfo; //# sourceMappingURL=ClientInfo.js.map