@frontegg/js 7.74.0-alpha.0 → 7.74.0

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.
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.74.0-alpha.0
1
+ /** @license Frontegg v7.74.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.74.0-alpha.0
1
+ /** @license Frontegg v7.74.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/node/version.js CHANGED
@@ -5,6 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _default = {
8
- cdnVersion: '7.74.0-alpha.0'
8
+ cdnVersion: '7.74.0'
9
9
  };
10
10
  exports["default"] = _default;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@frontegg/js",
3
- "version": "7.74.0-alpha.0",
3
+ "version": "7.74.0",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Frontegg LTD",
7
7
  "dependencies": {
8
8
  "@babel/runtime": "^7.18.6",
9
- "@frontegg/types": "7.74.0-alpha.0"
9
+ "@frontegg/types": "7.74.0"
10
10
  },
11
11
  "browserslist": {
12
12
  "production": [
@@ -1780,7 +1780,7 @@ __webpack_require__.r(__webpack_exports__);
1780
1780
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1781
1781
  /* harmony export */ });
1782
1782
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
1783
- cdnVersion: '7.74.0-alpha.0'
1783
+ cdnVersion: '7.74.0'
1784
1784
  });
1785
1785
 
1786
1786
  /***/ }),
@@ -5835,7 +5835,6 @@ const _excluded = ["callback", "error"],
5835
5835
  const preLogin = async payload => {
5836
5836
  const {
5837
5837
  email,
5838
- username,
5839
5838
  recaptchaToken,
5840
5839
  invitationToken,
5841
5840
  callback
@@ -5846,13 +5845,10 @@ const _excluded = ["callback", "error"],
5846
5845
  try {
5847
5846
  const onRedirectTo = store.auth.onRedirectTo;
5848
5847
  const tenantId = (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.getSearchParam)(_helpers__WEBPACK_IMPORTED_MODULE_12__.TENANT_ID_PARAM_KEY);
5849
- const preLoginResult = await api.auth.preLoginV2((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, email ? {
5850
- email
5851
- } : {}, username ? {
5852
- username
5853
- } : {}, {
5848
+ const preLoginResult = await api.auth.preLoginV2({
5849
+ email,
5854
5850
  tenantId
5855
- }));
5851
+ });
5856
5852
  const {
5857
5853
  address,
5858
5854
  idpType
@@ -5866,8 +5862,7 @@ const _excluded = ["callback", "error"],
5866
5862
  ssoRedirectUrl += `&redirect_uri=${window.location.origin}${oidcRedirectUrl}`;
5867
5863
  }
5868
5864
  if (_toolkit__WEBPACK_IMPORTED_MODULE_14__["default"].isLoginWithSSOAvailable()) {
5869
- var _ref4;
5870
- _toolkit__WEBPACK_IMPORTED_MODULE_14__["default"].loginWithSSO((_ref4 = email != null ? email : username) != null ? _ref4 : '');
5865
+ _toolkit__WEBPACK_IMPORTED_MODULE_14__["default"].loginWithSSO(email);
5871
5866
  setLoginState({
5872
5867
  loading: false
5873
5868
  });
@@ -5885,18 +5880,16 @@ const _excluded = ["callback", "error"],
5885
5880
  }, 2000);
5886
5881
  }
5887
5882
  } else {
5888
- var _ref5;
5889
5883
  await ssoPreloginFailed({
5890
- email: (_ref5 = email != null ? email : username) != null ? _ref5 : '',
5884
+ email,
5891
5885
  recaptchaToken,
5892
5886
  callback,
5893
5887
  invitationToken
5894
5888
  });
5895
5889
  }
5896
5890
  } catch (e) {
5897
- var _ref6;
5898
5891
  await ssoPreloginFailed({
5899
- email: (_ref6 = email != null ? email : username) != null ? _ref6 : '',
5892
+ email,
5900
5893
  recaptchaToken,
5901
5894
  callback,
5902
5895
  invitationToken,
@@ -5932,7 +5925,6 @@ const _excluded = ["callback", "error"],
5932
5925
  const login = async payload => {
5933
5926
  const {
5934
5927
  email,
5935
- username,
5936
5928
  password,
5937
5929
  recaptchaToken,
5938
5930
  invitationToken,
@@ -5946,15 +5938,12 @@ const _excluded = ["callback", "error"],
5946
5938
  user,
5947
5939
  tenants = [],
5948
5940
  activeTenant
5949
- } = await api.auth.loginv2((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, email ? {
5950
- email
5951
- } : {}, username ? {
5952
- username
5953
- } : {}, {
5941
+ } = await api.auth.loginv2({
5942
+ email,
5954
5943
  password,
5955
5944
  recaptchaToken,
5956
5945
  invitationToken
5957
- }));
5946
+ });
5958
5947
  const {
5959
5948
  onRedirectTo,
5960
5949
  routes
@@ -6194,7 +6183,6 @@ const _excluded = ["callback", "error"],
6194
6183
  } = _payload,
6195
6184
  payload = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(_payload, _excluded5);
6196
6185
  try {
6197
- var _username;
6198
6186
  setLoginState({
6199
6187
  loading: true
6200
6188
  });
@@ -6202,16 +6190,9 @@ const _excluded = ["callback", "error"],
6202
6190
  if ((0,_helpers__WEBPACK_IMPORTED_MODULE_12__.isEmailPayload)(payload)) {
6203
6191
  email = payload.email;
6204
6192
  }
6205
- let username;
6206
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_12__.isUsernamePayload)(payload)) {
6207
- username = payload.username;
6208
- }
6209
6193
  // TODO: [Typescript 4.8] fix @frontegg/rest-api return value
6210
6194
  // @ts-ignore
6211
- const preloginRes = await api.auth.passwordlessPreLogin((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, payload, {
6212
- email,
6213
- username: (_username = username) != null ? _username : ''
6214
- }));
6195
+ const preloginRes = await api.auth.passwordlessPreLogin(payload);
6215
6196
  // @ts-ignore
6216
6197
  const step = _consts__WEBPACK_IMPORTED_MODULE_16__.authStrategyLoginStepMap[payload.type];
6217
6198
  setLoginState({
@@ -6803,11 +6784,11 @@ const _excluded = ["callback", "error"],
6803
6784
  preserveQueryParams: true
6804
6785
  });
6805
6786
  } else {
6806
- var _ref7;
6787
+ var _ref4;
6807
6788
  if (user.id) {
6808
6789
  localStorage.setItem('userId', user.id);
6809
6790
  }
6810
- const quickLoginToRegister = (_ref7 = localStorage.getItem('register-quick-login')) != null ? _ref7 : loginState.quickLoginToRegister;
6791
+ const quickLoginToRegister = (_ref4 = localStorage.getItem('register-quick-login')) != null ? _ref4 : loginState.quickLoginToRegister;
6811
6792
  const shouldNavigateToRegisterQuickLogin = __shouldNavigateToRegisterQuickLogin(user);
6812
6793
  actions.afterAuthenticationStateUpdate({
6813
6794
  user: updatedUser,
@@ -7609,7 +7590,6 @@ __webpack_require__.r(__webpack_exports__);
7609
7590
  /* harmony export */ isAbsoluteUrl: () => (/* binding */ isAbsoluteUrl),
7610
7591
  /* harmony export */ isEmailPayload: () => (/* binding */ isEmailPayload),
7611
7592
  /* harmony export */ isOauthCallbackRoute: () => (/* binding */ isOauthCallbackRoute),
7612
- /* harmony export */ isUsernamePayload: () => (/* binding */ isUsernamePayload),
7613
7593
  /* harmony export */ shouldShowPasswordRotationPromptFunc: () => (/* binding */ shouldShowPasswordRotationPromptFunc)
7614
7594
  /* harmony export */ });
7615
7595
  /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/auth/interfaces.js");
@@ -7743,9 +7723,6 @@ const isOauthCallbackRoute = activeUri => {
7743
7723
  function isEmailPayload(payload) {
7744
7724
  return 'email' in payload;
7745
7725
  }
7746
- function isUsernamePayload(payload) {
7747
- return 'username' in payload;
7748
- }
7749
7726
  const getBaseNameWithoutSlashSuffix = state => {
7750
7727
  const basename = _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_2__.ContextHolder.for(state.root.appName).getBasename();
7751
7728
  if (basename != null && basename.endsWith('/')) {
@@ -16349,7 +16326,6 @@ __webpack_require__.r(__webpack_exports__);
16349
16326
  /* harmony export */ isOauthCallbackRoute: () => (/* reexport safe */ _LoginState_helpers__WEBPACK_IMPORTED_MODULE_3__.isOauthCallbackRoute),
16350
16327
  /* harmony export */ isResetPasswordRequired: () => (/* binding */ isResetPasswordRequired),
16351
16328
  /* harmony export */ isSteppedUp: () => (/* reexport safe */ _StepUpState_helpers__WEBPACK_IMPORTED_MODULE_4__.isSteppedUp),
16352
- /* harmony export */ isUsernamePayload: () => (/* reexport safe */ _LoginState_helpers__WEBPACK_IMPORTED_MODULE_3__.isUsernamePayload),
16353
16329
  /* harmony export */ mapMetaDataObjectToActions: () => (/* binding */ mapMetaDataObjectToActions),
16354
16330
  /* harmony export */ prepareIdentifiersForSignup: () => (/* binding */ prepareIdentifiersForSignup),
16355
16331
  /* harmony export */ redirectByStepUpUrl: () => (/* reexport safe */ _StepUpState_helpers__WEBPACK_IMPORTED_MODULE_4__.redirectByStepUpUrl),
@@ -18574,7 +18550,6 @@ __webpack_require__.r(__webpack_exports__);
18574
18550
  /* harmony export */ isProxy: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_2__.isProxy),
18575
18551
  /* harmony export */ isResetPasswordRequired: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.isResetPasswordRequired),
18576
18552
  /* harmony export */ isSteppedUp: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.isSteppedUp),
18577
- /* harmony export */ isUsernamePayload: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.isUsernamePayload),
18578
18553
  /* harmony export */ mapMetaDataObjectToActions: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.mapMetaDataObjectToActions),
18579
18554
  /* harmony export */ omitProps: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_2__.omitProps),
18580
18555
  /* harmony export */ prepareIdentifiersForSignup: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.prepareIdentifiersForSignup),
@@ -18600,7 +18575,7 @@ __webpack_require__.r(__webpack_exports__);
18600
18575
  /* harmony import */ var _subscriptions_interfaces__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./subscriptions/interfaces */ "../../dist/@frontegg/redux-store/subscriptions/interfaces.js");
18601
18576
  /* harmony import */ var _vendor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vendor */ "../../dist/@frontegg/redux-store/vendor/index.js");
18602
18577
  /* harmony import */ var _audits__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./audits */ "../../dist/@frontegg/redux-store/audits/index.js");
18603
- /** @license Frontegg v7.74.0-alpha.0
18578
+ /** @license Frontegg v7.74.0
18604
18579
  *
18605
18580
  * This source code is licensed under the MIT license found in the
18606
18581
  * LICENSE file in the root directory of this source tree.
@@ -24814,16 +24789,16 @@ __webpack_require__.r(__webpack_exports__);
24814
24789
  /* harmony export */ });
24815
24790
  class FronteggNativeModule {
24816
24791
  constructor() {
24817
- this.loginWithSSO = identifier => {
24792
+ this.loginWithSSO = email => {
24818
24793
  if (this.isIOSNativeBridgeAvailable()) {
24819
24794
  var _window$webkit, _window$webkit$messag, _window$webkit$messag2;
24820
24795
  (_window$webkit = window.webkit) == null ? void 0 : (_window$webkit$messag = _window$webkit.messageHandlers) == null ? void 0 : (_window$webkit$messag2 = _window$webkit$messag.FronteggNativeBridge) == null ? void 0 : _window$webkit$messag2.postMessage(JSON.stringify({
24821
24796
  action: 'loginWithSSO',
24822
- payload: identifier
24797
+ payload: email
24823
24798
  }));
24824
24799
  } else if (this.isAndroidNativeBridgeAvailable()) {
24825
24800
  var _window$FronteggNativ;
24826
- (_window$FronteggNativ = window.FronteggNativeBridge) == null ? void 0 : _window$FronteggNativ.loginWithSSO(identifier);
24801
+ (_window$FronteggNativ = window.FronteggNativeBridge) == null ? void 0 : _window$FronteggNativ.loginWithSSO(email);
24827
24802
  } else {
24828
24803
  throw new Error('FronteggNativeBridge is not available');
24829
24804
  }
@@ -26749,7 +26724,6 @@ const _excluded = ["type"],
26749
26724
 
26750
26725
 
26751
26726
 
26752
-
26753
26727
  class AuthenticationApi extends _BaseApiClient__WEBPACK_IMPORTED_MODULE_6__.BaseApiClient {
26754
26728
  constructor(appName) {
26755
26729
  super(appName);
@@ -27295,19 +27269,11 @@ class AuthenticationApi extends _BaseApiClient__WEBPACK_IMPORTED_MODULE_6__.Base
27295
27269
  });
27296
27270
  };
27297
27271
  this.passwordlessPreLogin = async _ref => {
27298
- var _usernameToTypeMapper;
27299
27272
  let {
27300
27273
  type
27301
27274
  } = _ref,
27302
27275
  body = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, _excluded);
27303
- const usernameToTypeMapper = {
27304
- [_enums__WEBPACK_IMPORTED_MODULE_3__.AuthStrategyEnum.UsernameAndCode]: _enums__WEBPACK_IMPORTED_MODULE_3__.AuthStrategyEnum.Code,
27305
- [_enums__WEBPACK_IMPORTED_MODULE_3__.AuthStrategyEnum.UsernameAndMagicLink]: _enums__WEBPACK_IMPORTED_MODULE_3__.AuthStrategyEnum.MagicLink,
27306
- [_enums__WEBPACK_IMPORTED_MODULE_3__.AuthStrategyEnum.UsernameAndSms]: _enums__WEBPACK_IMPORTED_MODULE_3__.AuthStrategyEnum.SmsCode,
27307
- [_enums__WEBPACK_IMPORTED_MODULE_3__.AuthStrategyEnum.UsernameAndPassword]: _enums__WEBPACK_IMPORTED_MODULE_3__.AuthStrategyEnum.EmailAndPassword
27308
- };
27309
- const mappedType = ((_usernameToTypeMapper = usernameToTypeMapper[type]) == null ? void 0 : _usernameToTypeMapper.toLowerCase()) || type.toLowerCase();
27310
- return this.post(`${_constants__WEBPACK_IMPORTED_MODULE_11__.urls.identity.auth.v1}/passwordless/${mappedType}/prelogin`, body);
27276
+ return this.post(`${_constants__WEBPACK_IMPORTED_MODULE_11__.urls.identity.auth.v1}/passwordless/${type.toLocaleLowerCase()}/prelogin`, body);
27311
27277
  };
27312
27278
  this.passwordlessPostLoginV2 = async _ref2 => {
27313
27279
  let {
@@ -28773,7 +28739,7 @@ __webpack_require__.r(__webpack_exports__);
28773
28739
  /* harmony import */ var _security_center_interfaces__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./security-center/interfaces */ "../../dist/@frontegg/rest-api/security-center/interfaces.js");
28774
28740
  /* harmony import */ var _applications_interfaces__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./applications/interfaces */ "../../dist/@frontegg/rest-api/applications/interfaces.js");
28775
28741
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./constants */ "../../dist/@frontegg/rest-api/constants.js");
28776
- /** @license Frontegg v7.74.0-alpha.0
28742
+ /** @license Frontegg v7.74.0
28777
28743
  *
28778
28744
  * This source code is licensed under the MIT license found in the
28779
28745
  * LICENSE file in the root directory of this source tree.
@@ -31407,7 +31373,7 @@ __webpack_require__.r(__webpack_exports__);
31407
31373
  /* harmony export */ });
31408
31374
  /* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
31409
31375
  /* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
31410
- /** @license Frontegg v7.74.0-alpha.0
31376
+ /** @license Frontegg v7.74.0
31411
31377
  *
31412
31378
  * This source code is licensed under the MIT license found in the
31413
31379
  * LICENSE file in the root directory of this source tree.