mftsccs-browser 2.1.218-beta → 2.1.220-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20799,7 +20799,7 @@ const CRYPTO_ALGO = "AES-GCM";
20799
20799
  */
20800
20800
  function deriveKey(salt) {
20801
20801
  return __awaiter(this, void 0, void 0, function* () {
20802
- const passphrase = location.origin;
20802
+ const passphrase = "mftsccs-browser-v1";
20803
20803
  const encoder = new TextEncoder();
20804
20804
  const rawKey = encoder.encode(passphrase);
20805
20805
  const keyMaterial = yield crypto.subtle.importKey("raw", rawKey.buffer, "PBKDF2", false, ["deriveKey"]);
@@ -20928,7 +20928,7 @@ class TokenStorage {
20928
20928
  */
20929
20929
  static saveUserProfile(signinResponse) {
20930
20930
  return __awaiter(this, void 0, void 0, function* () {
20931
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
20931
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
20932
20932
  try {
20933
20933
  // Support both { data: { token, ... } } and flat { token, ... }
20934
20934
  const data = (_a = signinResponse === null || signinResponse === void 0 ? void 0 : signinResponse.data) !== null && _a !== void 0 ? _a : signinResponse;
@@ -20938,15 +20938,16 @@ class TokenStorage {
20938
20938
  TokenStorage.BearerAccessToken = token;
20939
20939
  TokenStorage.refreshToken = refreshToken;
20940
20940
  // Build profile object (tokens included — encrypted at rest)
20941
+ // Support both raw API response format and flat IUser format
20941
20942
  const profile = {
20942
20943
  token,
20943
20944
  refreshToken,
20944
20945
  email: (_e = data === null || data === void 0 ? void 0 : data.email) !== null && _e !== void 0 ? _e : "",
20945
- userId: (_h = (_g = (_f = data === null || data === void 0 ? void 0 : data.entity) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.userId) !== null && _h !== void 0 ? _h : 0,
20946
- userConcept: (_j = data === null || data === void 0 ? void 0 : data.userConcept) !== null && _j !== void 0 ? _j : 0,
20947
- entityId: (_l = (_k = data === null || data === void 0 ? void 0 : data.entityDetails) === null || _k === void 0 ? void 0 : _k.id) !== null && _l !== void 0 ? _l : 0,
20948
- roles: (_m = data === null || data === void 0 ? void 0 : data.roles) !== null && _m !== void 0 ? _m : [],
20949
- amcode: btoa(JSON.stringify((_o = data === null || data === void 0 ? void 0 : data.roles) !== null && _o !== void 0 ? _o : [])),
20946
+ userId: (_k = (_j = (_h = (_g = (_f = data === null || data === void 0 ? void 0 : data.entity) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.userId) !== null && _h !== void 0 ? _h : data === null || data === void 0 ? void 0 : data.userId) !== null && _j !== void 0 ? _j : data === null || data === void 0 ? void 0 : data.theUserId) !== null && _k !== void 0 ? _k : 0,
20947
+ userConcept: (_l = data === null || data === void 0 ? void 0 : data.userConcept) !== null && _l !== void 0 ? _l : 0,
20948
+ entityId: (_p = (_o = (_m = data === null || data === void 0 ? void 0 : data.entityDetails) === null || _m === void 0 ? void 0 : _m.id) !== null && _o !== void 0 ? _o : data === null || data === void 0 ? void 0 : data.entityId) !== null && _p !== void 0 ? _p : 0,
20949
+ roles: (_q = data === null || data === void 0 ? void 0 : data.roles) !== null && _q !== void 0 ? _q : [],
20950
+ amcode: (_r = data === null || data === void 0 ? void 0 : data.amcode) !== null && _r !== void 0 ? _r : btoa(JSON.stringify((_s = data === null || data === void 0 ? void 0 : data.roles) !== null && _s !== void 0 ? _s : [])),
20950
20951
  };
20951
20952
  // Cache in memory for sync access
20952
20953
  TokenStorage.profileCache = profile;
@@ -20954,7 +20955,7 @@ class TokenStorage {
20954
20955
  yield (0,_SecureStorage__WEBPACK_IMPORTED_MODULE_0__.saveProfile)(profile);
20955
20956
  return true;
20956
20957
  }
20957
- catch (_p) {
20958
+ catch (_t) {
20958
20959
  return false;
20959
20960
  }
20960
20961
  });