UNPKG

msal-iframe-ok

Version:

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

54 lines 1.64 kB
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { Utils } from "./Utils"; import { ClientAuthError } from "./error/ClientAuthError"; /** * @hidden */ var ClientInfo = /** @class */ (function () { function ClientInfo(rawClientInfo) { if (!rawClientInfo || Utils.isEmpty(rawClientInfo)) { this.uid = ""; this.utid = ""; return; } try { var decodedClientInfo = 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.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; }()); export { ClientInfo }; //# sourceMappingURL=ClientInfo.js.map