@axinom/mosaic-portal 0.37.0 → 0.37.1

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.
@@ -32122,7 +32122,7 @@ var Login = function Login(_ref52) {
32122
32122
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("img", {
32123
32123
  alt: "Customer logo",
32124
32124
  src: (_b = brandingOptions === null || brandingOptions === void 0 ? void 0 : brandingOptions.companyLogo) !== null && _b !== void 0 ? _b : mosaicLogo
32125
- })), isDirectSignInEnabled && axAuthConfig.enabled && ( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", {
32125
+ })), isDirectSignInEnabled && (axAuthConfig === null || axAuthConfig === void 0 ? void 0 : axAuthConfig.enabled) && ( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", {
32126
32126
  className: classes$5.tabs
32127
32127
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", {
32128
32128
  className: activeTab === 'signIn' ? activeTabClass : classes$5.tab,
@@ -32142,7 +32142,7 @@ var Login = function Login(_ref52) {
32142
32142
  }, errorMessage && ( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", {
32143
32143
  className: classes$5.errorMessage,
32144
32144
  "data-test-id": "login-error-message"
32145
- }, errorMessage)), isDirectSignInEnabled && axAuthConfig.enabled && ( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Formik, {
32145
+ }, errorMessage)), isDirectSignInEnabled && (axAuthConfig === null || axAuthConfig === void 0 ? void 0 : axAuthConfig.enabled) && ( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Formik, {
32146
32146
  initialValues: {},
32147
32147
  onSubmit: function onSubmit() {
32148
32148
  return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
@@ -32197,9 +32197,9 @@ var Login = function Login(_ref52) {
32197
32197
  onClick: function onClick() {
32198
32198
  return setIsForgotPassword(true);
32199
32199
  }
32200
- }, "Forgot Password")))), isDirectSignInEnabled && axAuthConfig.enabled && enabledExternalProvidersCount > 0 && ( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", {
32200
+ }, "Forgot Password")))), isDirectSignInEnabled && (axAuthConfig === null || axAuthConfig === void 0 ? void 0 : axAuthConfig.enabled) && enabledExternalProvidersCount > 0 && ( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", {
32201
32201
  className: classes$5.separator
32202
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, "or"))), isDirectSignInEnabled && !axAuthConfig.enabled && ( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", {
32202
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, "or"))), isDirectSignInEnabled && !(axAuthConfig === null || axAuthConfig === void 0 ? void 0 : axAuthConfig.enabled) && ( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", {
32203
32203
  className: classes$5.authTitle
32204
32204
  }, "Sign In")), providersToRender.map(function (idp) {
32205
32205
  return idp.enabled && ( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", {
@@ -32593,21 +32593,22 @@ var EnsureAuthentication = function EnsureAuthentication(_ref56) {
32593
32593
  _context11.t1 = _context11.sent;
32594
32594
  (0, _context11.t0)(_context11.t1);
32595
32595
  case 12:
32596
- _context11.next = 17;
32596
+ _context11.next = 18;
32597
32597
  break;
32598
32598
  case 14:
32599
32599
  _context11.prev = 14;
32600
32600
  _context11.t2 = _context11["catch"](1);
32601
+ console.error(_context11.t2);
32601
32602
  setIsProbableApiMismatch(true);
32602
- case 17:
32603
- _context11.prev = 17;
32603
+ case 18:
32604
+ _context11.prev = 18;
32604
32605
  setLoading(false);
32605
- return _context11.finish(17);
32606
- case 20:
32606
+ return _context11.finish(18);
32607
+ case 21:
32607
32608
  case "end":
32608
32609
  return _context11.stop();
32609
32610
  }
32610
- }, _callee11, null, [[1, 14, 17, 20]]);
32611
+ }, _callee11, null, [[1, 14, 18, 21]]);
32611
32612
  }));
32612
32613
  };
32613
32614
  initialize();
@@ -36601,6 +36602,7 @@ var createIdentityServiceClient = function createIdentityServiceClient(config) {
36601
36602
  }));
36602
36603
  };
36603
36604
  var tokenLoadingPromise = null;
36605
+ var axAuthClientId;
36604
36606
  return {
36605
36607
  /**
36606
36608
  * Adds an event handler that will be raised whenever a new token response is loaded from the backend.
@@ -36639,6 +36641,9 @@ var createIdentityServiceClient = function createIdentityServiceClient(config) {
36639
36641
  }
36640
36642
  providers = configStatusResponse.enabledIdentityProviders.map(function (idpConfig) {
36641
36643
  var _a, _b;
36644
+ if (idpConfig.idProvider === dist.IdentityProvider.AX_AUTH) {
36645
+ axAuthClientId = idpConfig.clientId;
36646
+ }
36642
36647
  return {
36643
36648
  idpId: idpConfig.idProvider,
36644
36649
  displayName: (_a = idpConfig.customBrandingConfig.displayName) !== null && _a !== void 0 ? _a : '',
@@ -36778,33 +36783,162 @@ var createIdentityServiceClient = function createIdentityServiceClient(config) {
36778
36783
  },
36779
36784
  initiateSignUp: function initiateSignUp(initiateSignUpRequest, axAuthManagementBaseUrl) {
36780
36785
  return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
36786
+ var variables, userSignUpResponse, _responseBody, responseBody, error;
36781
36787
  return _regeneratorRuntime().wrap(function _callee20$(_context20) {
36782
36788
  while (1) switch (_context20.prev = _context20.next) {
36783
36789
  case 0:
36790
+ if (axAuthClientId) {
36791
+ _context20.next = 2;
36792
+ break;
36793
+ }
36784
36794
  throw new Error('Invalid configuration. AxAuthClientId is missing.');
36785
- case 1:
36795
+ case 2:
36796
+ variables = {
36797
+ input: {
36798
+ firstName: initiateSignUpRequest.firstName,
36799
+ lastName: initiateSignUpRequest.lastName,
36800
+ email: initiateSignUpRequest.email,
36801
+ password: initiateSignUpRequest.password,
36802
+ oAuthClientId: axAuthClientId
36803
+ }
36804
+ };
36805
+ _context20.prev = 3;
36806
+ _context20.next = 6;
36807
+ return fetch("".concat(axAuthManagementBaseUrl), {
36808
+ method: 'POST',
36809
+ cache: 'no-cache',
36810
+ redirect: 'follow',
36811
+ referrerPolicy: 'origin',
36812
+ headers: {
36813
+ 'content-type': 'application/json'
36814
+ },
36815
+ body: stringifyGqlQuery(InitiateManagementUserSignUpDocument, variables)
36816
+ });
36817
+ case 6:
36818
+ userSignUpResponse = _context20.sent;
36819
+ if (!userSignUpResponse.ok) {
36820
+ _context20.next = 14;
36821
+ break;
36822
+ }
36823
+ _context20.next = 10;
36824
+ return userSignUpResponse.json();
36825
+ case 10:
36826
+ _responseBody = _context20.sent;
36827
+ if (!_responseBody.errors) {
36828
+ _context20.next = 13;
36829
+ break;
36830
+ }
36831
+ return _context20.abrupt("return", {
36832
+ isSuccess: false,
36833
+ errorMessage: _responseBody.errors[0].message
36834
+ });
36835
+ case 13:
36836
+ return _context20.abrupt("return", {
36837
+ isSuccess: true
36838
+ });
36839
+ case 14:
36840
+ _context20.next = 16;
36841
+ return userSignUpResponse.text();
36842
+ case 16:
36843
+ responseBody = _context20.sent;
36844
+ return _context20.abrupt("return", {
36845
+ isSuccess: false,
36846
+ errorMessage: "Unknown error occurred while initiating user sign up process. Original error: ".concat(responseBody)
36847
+ });
36848
+ case 20:
36849
+ _context20.prev = 20;
36850
+ _context20.t0 = _context20["catch"](3);
36851
+ error = _context20.t0;
36852
+ return _context20.abrupt("return", {
36853
+ isSuccess: false,
36854
+ errorMessage: "Unknown error occurred while initiating user sign up process. Original error: ".concat(error.message)
36855
+ });
36856
+ case 24:
36786
36857
  case "end":
36787
36858
  return _context20.stop();
36788
36859
  }
36789
- }, _callee20);
36860
+ }, _callee20, null, [[3, 20]]);
36790
36861
  }));
36791
36862
  },
36792
36863
  initiatePasswordReset: function initiatePasswordReset(email, axAuthManagementBaseUrl) {
36793
36864
  return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
36865
+ var variables, passwordResetResponse, _responseBody2, responseBody, error;
36794
36866
  return _regeneratorRuntime().wrap(function _callee21$(_context21) {
36795
36867
  while (1) switch (_context21.prev = _context21.next) {
36796
36868
  case 0:
36869
+ if (axAuthClientId) {
36870
+ _context21.next = 2;
36871
+ break;
36872
+ }
36797
36873
  throw new Error('Invalid configuration. AxAuthClientId is missing.');
36798
- case 1:
36874
+ case 2:
36875
+ variables = {
36876
+ input: {
36877
+ email: email,
36878
+ oAuthClientId: axAuthClientId
36879
+ }
36880
+ };
36881
+ _context21.prev = 3;
36882
+ _context21.next = 6;
36883
+ return fetch("".concat(axAuthManagementBaseUrl), {
36884
+ method: 'POST',
36885
+ cache: 'no-cache',
36886
+ redirect: 'follow',
36887
+ referrerPolicy: 'origin',
36888
+ headers: {
36889
+ 'content-type': 'application/json'
36890
+ },
36891
+ body: stringifyGqlQuery(InitiateManagementUserPasswordResetDocument, variables)
36892
+ });
36893
+ case 6:
36894
+ passwordResetResponse = _context21.sent;
36895
+ if (!passwordResetResponse.ok) {
36896
+ _context21.next = 14;
36897
+ break;
36898
+ }
36899
+ _context21.next = 10;
36900
+ return passwordResetResponse.json();
36901
+ case 10:
36902
+ _responseBody2 = _context21.sent;
36903
+ if (!_responseBody2.errors) {
36904
+ _context21.next = 13;
36905
+ break;
36906
+ }
36907
+ return _context21.abrupt("return", {
36908
+ isSuccess: false,
36909
+ errorMessage: _responseBody2.errors[0].message
36910
+ });
36911
+ case 13:
36912
+ return _context21.abrupt("return", {
36913
+ isSuccess: true
36914
+ });
36915
+ case 14:
36916
+ _context21.next = 16;
36917
+ return passwordResetResponse.text();
36918
+ case 16:
36919
+ responseBody = _context21.sent;
36920
+ return _context21.abrupt("return", {
36921
+ isSuccess: false,
36922
+ errorMessage: "Unknown error occurred while initiating password reset process. Original error: ".concat(responseBody)
36923
+ });
36924
+ case 20:
36925
+ _context21.prev = 20;
36926
+ _context21.t0 = _context21["catch"](3);
36927
+ error = _context21.t0;
36928
+ return _context21.abrupt("return", {
36929
+ isSuccess: false,
36930
+ errorMessage: "Unknown error occurred while initiating password reset process. Original error: ".concat(error.message)
36931
+ });
36932
+ case 24:
36799
36933
  case "end":
36800
36934
  return _context21.stop();
36801
36935
  }
36802
- }, _callee21);
36936
+ }, _callee21, null, [[3, 20]]);
36803
36937
  }));
36804
36938
  },
36805
36939
  completePasswordReset: function completePasswordReset(resetOtp, newPassword, axAuthManagementBaseUrl) {
36806
36940
  return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
36807
- var variables, completePasswordResetResponse, _responseBody, responseBody, error;
36941
+ var variables, completePasswordResetResponse, _responseBody3, responseBody, error;
36808
36942
  return _regeneratorRuntime().wrap(function _callee22$(_context22) {
36809
36943
  while (1) switch (_context22.prev = _context22.next) {
36810
36944
  case 0:
@@ -36835,14 +36969,14 @@ var createIdentityServiceClient = function createIdentityServiceClient(config) {
36835
36969
  _context22.next = 8;
36836
36970
  return completePasswordResetResponse.json();
36837
36971
  case 8:
36838
- _responseBody = _context22.sent;
36839
- if (!_responseBody.errors) {
36972
+ _responseBody3 = _context22.sent;
36973
+ if (!_responseBody3.errors) {
36840
36974
  _context22.next = 11;
36841
36975
  break;
36842
36976
  }
36843
36977
  return _context22.abrupt("return", {
36844
36978
  isSuccess: false,
36845
- errorMessage: _responseBody.errors[0].message
36979
+ errorMessage: _responseBody3.errors[0].message
36846
36980
  });
36847
36981
  case 11:
36848
36982
  return _context22.abrupt("return", {
@@ -36874,7 +37008,7 @@ var createIdentityServiceClient = function createIdentityServiceClient(config) {
36874
37008
  },
36875
37009
  completeUserSignUp: function completeUserSignUp(signUpOtp, axAuthManagementBaseUrl) {
36876
37010
  return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
36877
- var variables, completeUserSignUpResponse, _responseBody2, responseBody, error;
37011
+ var variables, completeUserSignUpResponse, _responseBody4, responseBody, error;
36878
37012
  return _regeneratorRuntime().wrap(function _callee23$(_context23) {
36879
37013
  while (1) switch (_context23.prev = _context23.next) {
36880
37014
  case 0:
@@ -36904,14 +37038,14 @@ var createIdentityServiceClient = function createIdentityServiceClient(config) {
36904
37038
  _context23.next = 8;
36905
37039
  return completeUserSignUpResponse.json();
36906
37040
  case 8:
36907
- _responseBody2 = _context23.sent;
36908
- if (!_responseBody2.errors) {
37041
+ _responseBody4 = _context23.sent;
37042
+ if (!_responseBody4.errors) {
36909
37043
  _context23.next = 11;
36910
37044
  break;
36911
37045
  }
36912
37046
  return _context23.abrupt("return", {
36913
37047
  isSuccess: false,
36914
- errorMessage: _responseBody2.errors[0].message
37048
+ errorMessage: _responseBody4.errors[0].message
36915
37049
  });
36916
37050
  case 11:
36917
37051
  return _context23.abrupt("return", {
@@ -40439,7 +40573,7 @@ __webpack_require__.r(__webpack_exports__);
40439
40573
  /* harmony export */ });
40440
40574
  var shellInfo = {
40441
40575
  name: "@axinom/mosaic-portal",
40442
- version: "0.37.0"
40576
+ version: "0.37.1"
40443
40577
  };
40444
40578
 
40445
40579
  /***/ }),
@@ -45553,11 +45687,11 @@ function installPiralDebug(options) {
45553
45687
  debug: debugApiVersion,
45554
45688
  instance: {
45555
45689
  name: "@axinom/mosaic-portal",
45556
- version: "0.37.0",
45690
+ version: "0.37.1",
45557
45691
  dependencies: "react,react-dom,react-router,react-router-dom,tslib",
45558
45692
  },
45559
45693
  build: {
45560
- date: "2024-10-09T06:23:46.402Z",
45694
+ date: "2024-10-14T06:02:29.018Z",
45561
45695
  cli: "1.5.2",
45562
45696
  compat: "1",
45563
45697
  },
@@ -93998,4 +94132,4 @@ var App = function App() {
93998
94132
 
93999
94133
  /******/ })()
94000
94134
  ;
94001
- //# sourceMappingURL=index.c4fb51.js.map
94135
+ //# sourceMappingURL=index.b3f102.js.map