@frontegg/rest-api 7.57.0-alpha.6 → 7.58.0-alpha.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.
@@ -129,6 +129,7 @@ export declare class ContextHolder {
129
129
  */
130
130
  static isSessionPerTenantEnabled(appName?: string): boolean;
131
131
  isSessionPerTenantEnabled: () => boolean;
132
+ shouldSkipUserLoad: () => boolean;
132
133
  /**
133
134
  * @deprecated - use ContextHolder.for(appName).getAppName instead
134
135
  * @returns app name value
@@ -68,6 +68,10 @@ export class ContextHolder {
68
68
  var _this$sessionContext;
69
69
  return ((_this$sessionContext = this.sessionContext) == null ? void 0 : _this$sessionContext.enableSessionPerTenant) || false;
70
70
  };
71
+ this.shouldSkipUserLoad = () => {
72
+ var _this$sessionContext2;
73
+ return ((_this$sessionContext2 = this.sessionContext) == null ? void 0 : _this$sessionContext2.skipUserLoading) || false;
74
+ };
71
75
  this.getAppName = () => {
72
76
  return this.appName;
73
77
  };
package/auth/index.d.ts CHANGED
@@ -49,8 +49,6 @@ export declare class AuthenticationApi extends BaseApiClient {
49
49
  * Login with username and password.
50
50
  * If the user has two-factor authentication, the server will return mfaToken with mfaRequired: true,
51
51
  * and then `loginWithMfa` should be called with the mfaToken and generated code.
52
- * If the password is expired, the server will return resetPasswordToken.
53
- * If password rotation configuration is enabled and password not expired, the server will return passwordExpiresIn and notificationPeriod.
54
52
  * Otherwise, the server will accessToken and refreshToken.
55
53
  * The refresh token should be used to renew your access token by calling `refreshToken`.
56
54
  * @throw exception if login failed
package/auth/index.js CHANGED
@@ -708,6 +708,10 @@ export class AuthenticationApi extends BaseApiClient {
708
708
  }
709
709
  };
710
710
  this.getMeAndEntitlements = async () => {
711
+ const shouldSkipUserLoad = ContextHolder.for(this.appName).shouldSkipUserLoad();
712
+ if (shouldSkipUserLoad) {
713
+ return {};
714
+ }
711
715
  const actions = [{
712
716
  action: this.getMeV2,
713
717
  shouldLoad: true
@@ -54,10 +54,6 @@ export type ILoginResponse = IUserProfile & {
54
54
  amr?: string[];
55
55
  acr?: string;
56
56
  auth_time?: number;
57
- resetPasswordToken?: string;
58
- passwordExpiresIn?: number;
59
- notificationPeriod?: number;
60
- userId?: string;
61
57
  };
62
58
  export type ILoginResponseV2 = {
63
59
  user: ILoginResponse;
package/auth/utils.js CHANGED
@@ -26,6 +26,13 @@ export function getTabTenantFromSessionStorage(appName) {
26
26
  return sessionStorage.getItem(FRONTEGG_SEPARATE_TABS_BY_TENANT);
27
27
  }
28
28
  export function getCurrentUserTenantsFunction(appName) {
29
+ const skipUserLoading = ContextHolder.for(appName).shouldSkipUserLoad();
30
+ if (skipUserLoading) {
31
+ return async () => ({
32
+ tenants: [],
33
+ activeTenant: {}
34
+ });
35
+ }
29
36
  const usersApi = new UsersApi(appName);
30
37
  const [useCurrentUserTenantsV1] = FeatureFlags.getFeatureFlags([USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF], appName);
31
38
  if (ContextHolder.for(appName).isSessionPerTenantEnabled()) {
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.57.0-alpha.6
1
+ /** @license Frontegg v7.58.0-alpha.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/interfaces.d.ts CHANGED
@@ -57,6 +57,7 @@ export interface MetadataHeaders {
57
57
  }
58
58
  export interface SessionContext {
59
59
  enableSessionPerTenant?: boolean;
60
+ skipUserLoading?: boolean;
60
61
  }
61
62
  export interface ContextOptions {
62
63
  baseUrl: string | ((url: string) => string);
@@ -74,6 +74,10 @@ class ContextHolder {
74
74
  var _this$sessionContext;
75
75
  return ((_this$sessionContext = this.sessionContext) == null ? void 0 : _this$sessionContext.enableSessionPerTenant) || false;
76
76
  };
77
+ this.shouldSkipUserLoad = () => {
78
+ var _this$sessionContext2;
79
+ return ((_this$sessionContext2 = this.sessionContext) == null ? void 0 : _this$sessionContext2.skipUserLoading) || false;
80
+ };
77
81
  this.getAppName = () => {
78
82
  return this.appName;
79
83
  };
@@ -774,6 +774,10 @@ class AuthenticationApi extends _BaseApiClient.BaseApiClient {
774
774
  }
775
775
  };
776
776
  this.getMeAndEntitlements = async () => {
777
+ const shouldSkipUserLoad = _ContextHolder.ContextHolder.for(this.appName).shouldSkipUserLoad();
778
+ if (shouldSkipUserLoad) {
779
+ return {};
780
+ }
777
781
  const actions = [{
778
782
  action: this.getMeV2,
779
783
  shouldLoad: true
@@ -35,6 +35,13 @@ function getTabTenantFromSessionStorage(appName) {
35
35
  return sessionStorage.getItem(_constants.FRONTEGG_SEPARATE_TABS_BY_TENANT);
36
36
  }
37
37
  function getCurrentUserTenantsFunction(appName) {
38
+ const skipUserLoading = _ContextHolder.ContextHolder.for(appName).shouldSkipUserLoad();
39
+ if (skipUserLoading) {
40
+ return async () => ({
41
+ tenants: [],
42
+ activeTenant: {}
43
+ });
44
+ }
38
45
  const usersApi = new _users.UsersApi(appName);
39
46
  const [useCurrentUserTenantsV1] = _featureFlags.FeatureFlags.getFeatureFlags([_constants.USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF], appName);
40
47
  if (_ContextHolder.ContextHolder.for(appName).isSessionPerTenantEnabled()) {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.57.0-alpha.6
1
+ /** @license Frontegg v7.58.0-alpha.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "7.57.0-alpha.6",
3
+ "version": "7.58.0-alpha.0",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Frontegg LTD",