@frontegg/js 6.131.0-alpha.1 → 6.132.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.
@@ -35,6 +35,11 @@ export declare class FronteggApp {
35
35
  */
36
36
  private setEntitlementsOptions;
37
37
  loadAdminBoxMetadata: () => Promise<void>;
38
+ /**
39
+ * Loading required information on first load, mainly for refresh token and initial data.
40
+ * In case of hosted login - we let the user decide if he wants to load the user on first load or keep the old behaviour of loading
41
+ * The user by loginWithRedirect on demand. This param loadUserOnFirstLoad is mainly to not breaking an API and give 2 options.
42
+ */
38
43
  requestAuthorize: () => Promise<void>;
39
44
  loadFeatureFlags: () => Promise<void>;
40
45
  /**
@@ -16,7 +16,7 @@ import { mockFlagsList } from '../utils/mockFlagsList';
16
16
  export var FronteggApp = /*#__PURE__*/function () {
17
17
  function FronteggApp(_options, name) {
18
18
  var _this = this,
19
- _this$options$authOpt;
19
+ _this$options$authOpt3;
20
20
  var iframeRendering = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
21
21
  var allowMultipleRenderers = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
22
22
  _classCallCheck(this, FronteggApp);
@@ -71,11 +71,14 @@ export var FronteggApp = /*#__PURE__*/function () {
71
71
  }, _callee, null, [[2, 9]]);
72
72
  }));
73
73
  this.requestAuthorize = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
74
+ var _this$options$authOpt, _this$options$authOpt2;
75
+ var shouldRequestHostedLoginAuthorize;
74
76
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
75
77
  while (1) switch (_context2.prev = _context2.next) {
76
78
  case 0:
79
+ shouldRequestHostedLoginAuthorize = (_this$options$authOpt = _this.options.authOptions) == null ? void 0 : (_this$options$authOpt2 = _this$options$authOpt.hostedLoginOptions) == null ? void 0 : _this$options$authOpt2.loadUserOnFirstLoad;
77
80
  if (!_this.options.builderMode && _this.options.framework !== 'nextjs') {
78
- if (_this.options.hostedLoginBox && !_this.options.customLoginBox) {
81
+ if (_this.options.hostedLoginBox && !_this.options.customLoginBox && shouldRequestHostedLoginAuthorize) {
79
82
  _this.store.dispatch({
80
83
  type: 'auth/requestHostedLoginAuthorizeV2',
81
84
  payload: {
@@ -90,7 +93,7 @@ export var FronteggApp = /*#__PURE__*/function () {
90
93
  });
91
94
  }
92
95
  }
93
- case 1:
96
+ case 2:
94
97
  case "end":
95
98
  return _context2.stop();
96
99
  }
@@ -158,19 +161,19 @@ export var FronteggApp = /*#__PURE__*/function () {
158
161
  }) : {
159
162
  hostedLoginBox: this.options.hostedLoginBox
160
163
  };
161
- authOptions.disableSilentRefresh = (_this$options$authOpt = this.options.authOptions) == null ? void 0 : _this$options$authOpt.disableSilentRefresh;
164
+ authOptions.disableSilentRefresh = (_this$options$authOpt3 = this.options.authOptions) == null ? void 0 : _this$options$authOpt3.disableSilentRefresh;
162
165
  if (this.options.store) {
163
166
  this.store = this.options.store;
164
167
  if (!allowMultipleRenderers && this.options.store.getState().root.appName !== name) {
165
168
  throw Error('Mismatch in store names');
166
169
  }
167
170
  } else {
168
- var _this$options$authOpt2, _this$options$auditsO;
171
+ var _this$options$authOpt4, _this$options$auditsO;
169
172
  this.store = createFronteggStore({
170
173
  context: this.options.contextOptions,
171
174
  appName: this.name
172
175
  }, this, this.options.previewMode, authOptions, {
173
- auth: (_this$options$authOpt2 = this.options.authOptions) != null ? _this$options$authOpt2 : {},
176
+ auth: (_this$options$authOpt4 = this.options.authOptions) != null ? _this$options$authOpt4 : {},
174
177
  audits: (_this$options$auditsO = this.options.auditsOptions) != null ? _this$options$auditsO : {}
175
178
  }, false, this.options.urlStrategy);
176
179
  }
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.131.0-alpha.1
1
+ /** @license Frontegg v6.132.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.
@@ -23,7 +23,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
23
23
  var FronteggApp = /*#__PURE__*/function () {
24
24
  function FronteggApp(_options, name) {
25
25
  var _this = this,
26
- _this$options$authOpt;
26
+ _this$options$authOpt3;
27
27
  var iframeRendering = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
28
28
  var allowMultipleRenderers = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
29
29
  (0, _classCallCheck2["default"])(this, FronteggApp);
@@ -78,11 +78,14 @@ var FronteggApp = /*#__PURE__*/function () {
78
78
  }, _callee, null, [[2, 9]]);
79
79
  }));
80
80
  this.requestAuthorize = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
81
+ var _this$options$authOpt, _this$options$authOpt2;
82
+ var shouldRequestHostedLoginAuthorize;
81
83
  return _regenerator["default"].wrap(function _callee2$(_context2) {
82
84
  while (1) switch (_context2.prev = _context2.next) {
83
85
  case 0:
86
+ shouldRequestHostedLoginAuthorize = (_this$options$authOpt = _this.options.authOptions) == null ? void 0 : (_this$options$authOpt2 = _this$options$authOpt.hostedLoginOptions) == null ? void 0 : _this$options$authOpt2.loadUserOnFirstLoad;
84
87
  if (!_this.options.builderMode && _this.options.framework !== 'nextjs') {
85
- if (_this.options.hostedLoginBox && !_this.options.customLoginBox) {
88
+ if (_this.options.hostedLoginBox && !_this.options.customLoginBox && shouldRequestHostedLoginAuthorize) {
86
89
  _this.store.dispatch({
87
90
  type: 'auth/requestHostedLoginAuthorizeV2',
88
91
  payload: {
@@ -97,7 +100,7 @@ var FronteggApp = /*#__PURE__*/function () {
97
100
  });
98
101
  }
99
102
  }
100
- case 1:
103
+ case 2:
101
104
  case "end":
102
105
  return _context2.stop();
103
106
  }
@@ -165,19 +168,19 @@ var FronteggApp = /*#__PURE__*/function () {
165
168
  }) : {
166
169
  hostedLoginBox: this.options.hostedLoginBox
167
170
  };
168
- authOptions.disableSilentRefresh = (_this$options$authOpt = this.options.authOptions) == null ? void 0 : _this$options$authOpt.disableSilentRefresh;
171
+ authOptions.disableSilentRefresh = (_this$options$authOpt3 = this.options.authOptions) == null ? void 0 : _this$options$authOpt3.disableSilentRefresh;
169
172
  if (this.options.store) {
170
173
  this.store = this.options.store;
171
174
  if (!allowMultipleRenderers && this.options.store.getState().root.appName !== name) {
172
175
  throw Error('Mismatch in store names');
173
176
  }
174
177
  } else {
175
- var _this$options$authOpt2, _this$options$auditsO;
178
+ var _this$options$authOpt4, _this$options$auditsO;
176
179
  this.store = (0, _reduxStore.createFronteggStore)({
177
180
  context: this.options.contextOptions,
178
181
  appName: this.name
179
182
  }, this, this.options.previewMode, authOptions, {
180
- auth: (_this$options$authOpt2 = this.options.authOptions) != null ? _this$options$authOpt2 : {},
183
+ auth: (_this$options$authOpt4 = this.options.authOptions) != null ? _this$options$authOpt4 : {},
181
184
  audits: (_this$options$auditsO = this.options.auditsOptions) != null ? _this$options$auditsO : {}
182
185
  }, false, this.options.urlStrategy);
183
186
  }
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.131.0-alpha.1
1
+ /** @license Frontegg v6.132.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: '6.131.0-alpha.1'
8
+ cdnVersion: '6.132.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": "6.131.0-alpha.1",
3
+ "version": "6.132.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": "6.131.0-alpha.1"
9
+ "@frontegg/types": "6.132.0"
10
10
  },
11
11
  "browserslist": {
12
12
  "production": [
@@ -331,7 +331,7 @@ __webpack_require__.r(__webpack_exports__);
331
331
  var FronteggApp = /*#__PURE__*/function () {
332
332
  function FronteggApp(_options, name) {
333
333
  var _this = this,
334
- _this$options$authOpt;
334
+ _this$options$authOpt3;
335
335
  var iframeRendering = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
336
336
  var allowMultipleRenderers = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
337
337
  (0,_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, FronteggApp);
@@ -386,11 +386,14 @@ var FronteggApp = /*#__PURE__*/function () {
386
386
  }, _callee, null, [[2, 9]]);
387
387
  }));
388
388
  this.requestAuthorize = /*#__PURE__*/(0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function _callee2() {
389
+ var _this$options$authOpt, _this$options$authOpt2;
390
+ var shouldRequestHostedLoginAuthorize;
389
391
  return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function _callee2$(_context2) {
390
392
  while (1) switch (_context2.prev = _context2.next) {
391
393
  case 0:
394
+ shouldRequestHostedLoginAuthorize = (_this$options$authOpt = _this.options.authOptions) == null ? void 0 : (_this$options$authOpt2 = _this$options$authOpt.hostedLoginOptions) == null ? void 0 : _this$options$authOpt2.loadUserOnFirstLoad;
392
395
  if (!_this.options.builderMode && _this.options.framework !== 'nextjs') {
393
- if (_this.options.hostedLoginBox && !_this.options.customLoginBox) {
396
+ if (_this.options.hostedLoginBox && !_this.options.customLoginBox && shouldRequestHostedLoginAuthorize) {
394
397
  _this.store.dispatch({
395
398
  type: 'auth/requestHostedLoginAuthorizeV2',
396
399
  payload: {
@@ -405,7 +408,7 @@ var FronteggApp = /*#__PURE__*/function () {
405
408
  });
406
409
  }
407
410
  }
408
- case 1:
411
+ case 2:
409
412
  case "end":
410
413
  return _context2.stop();
411
414
  }
@@ -473,19 +476,19 @@ var FronteggApp = /*#__PURE__*/function () {
473
476
  }) : {
474
477
  hostedLoginBox: this.options.hostedLoginBox
475
478
  };
476
- authOptions.disableSilentRefresh = (_this$options$authOpt = this.options.authOptions) == null ? void 0 : _this$options$authOpt.disableSilentRefresh;
479
+ authOptions.disableSilentRefresh = (_this$options$authOpt3 = this.options.authOptions) == null ? void 0 : _this$options$authOpt3.disableSilentRefresh;
477
480
  if (this.options.store) {
478
481
  this.store = this.options.store;
479
482
  if (!allowMultipleRenderers && this.options.store.getState().root.appName !== name) {
480
483
  throw Error('Mismatch in store names');
481
484
  }
482
485
  } else {
483
- var _this$options$authOpt2, _this$options$auditsO;
486
+ var _this$options$authOpt4, _this$options$auditsO;
484
487
  this.store = (0,_frontegg_redux_store__WEBPACK_IMPORTED_MODULE_12__.createFronteggStore)({
485
488
  context: this.options.contextOptions,
486
489
  appName: this.name
487
490
  }, this, this.options.previewMode, authOptions, {
488
- auth: (_this$options$authOpt2 = this.options.authOptions) != null ? _this$options$authOpt2 : {},
491
+ auth: (_this$options$authOpt4 = this.options.authOptions) != null ? _this$options$authOpt4 : {},
489
492
  audits: (_this$options$auditsO = this.options.auditsOptions) != null ? _this$options$auditsO : {}
490
493
  }, false, this.options.urlStrategy);
491
494
  }
@@ -1318,7 +1321,7 @@ __webpack_require__.r(__webpack_exports__);
1318
1321
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1319
1322
  /* harmony export */ });
1320
1323
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
1321
- cdnVersion: '6.131.0-alpha.1'
1324
+ cdnVersion: '6.132.0'
1322
1325
  });
1323
1326
 
1324
1327
  /***/ }),
@@ -22298,7 +22301,7 @@ __webpack_require__.r(__webpack_exports__);
22298
22301
  /* harmony export */ });
22299
22302
  /* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
22300
22303
  /* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
22301
- /** @license Frontegg v6.131.0-alpha.1
22304
+ /** @license Frontegg v6.132.0
22302
22305
  *
22303
22306
  * This source code is licensed under the MIT license found in the
22304
22307
  * LICENSE file in the root directory of this source tree.