@frontegg/rest-api 3.1.29 → 3.1.30
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/ContextHolder/index.d.ts +10 -1
- package/ContextHolder/index.js +12 -0
- package/auth/constants.d.ts +5 -0
- package/auth/constants.js +2 -0
- package/auth/index.d.ts +7 -6
- package/auth/index.js +43 -14
- package/auth/interfaces.d.ts +0 -3
- package/auth/utils.d.ts +4 -0
- package/auth/utils.js +28 -0
- package/constants.d.ts +1 -0
- package/constants.js +1 -0
- package/index.js +1 -1
- package/interfaces.d.ts +3 -0
- package/node/ContextHolder/index.js +12 -0
- package/node/auth/constants.js +10 -0
- package/node/auth/index.js +58 -17
- package/node/auth/utils.js +38 -0
- package/node/constants.js +1 -0
- package/node/index.js +1 -1
- package/node/tenants/index.js +8 -0
- package/node/users/index.js +7 -0
- package/package.json +1 -1
- package/tenants/index.js +6 -0
- package/users/index.d.ts +7 -0
- package/users/index.js +5 -0
package/ContextHolder/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContextOptions, RedirectOptions, RequestSource } from '../interfaces';
|
|
1
|
+
import { SessionContext, ContextOptions, RedirectOptions, RequestSource } from '../interfaces';
|
|
2
2
|
import { IUserProfile } from "../users/interfaces";
|
|
3
3
|
/**
|
|
4
4
|
* Entitlements config from frontegg provider
|
|
@@ -16,6 +16,7 @@ export declare class ContextHolder {
|
|
|
16
16
|
private logout;
|
|
17
17
|
private entitlementsOptions;
|
|
18
18
|
private appName;
|
|
19
|
+
private sessionContext?;
|
|
19
20
|
private constructor();
|
|
20
21
|
static getInstance(): ContextHolder;
|
|
21
22
|
static setContext(context: ContextOptions): void;
|
|
@@ -29,6 +30,10 @@ export declare class ContextHolder {
|
|
|
29
30
|
* @param entitlementsOptions frontegg options entitlements config
|
|
30
31
|
*/
|
|
31
32
|
static setEntitlementsOptions(entitlementsOptions: EntitlementsOptions): void;
|
|
33
|
+
/**
|
|
34
|
+
* @param sessionContext frontegg options SessionContext config
|
|
35
|
+
*/
|
|
36
|
+
static setSessionContext(sessionContext: SessionContext): void;
|
|
32
37
|
/**
|
|
33
38
|
* @param appName for feature flags e.g.
|
|
34
39
|
*/
|
|
@@ -43,6 +48,10 @@ export declare class ContextHolder {
|
|
|
43
48
|
* @returns shouldLoadEntitlements. Default to false.
|
|
44
49
|
*/
|
|
45
50
|
static shouldLoadEntitlements(): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* @returns isSessionPerTenantEnabled. Default to false.
|
|
53
|
+
*/
|
|
54
|
+
static isSessionPerTenantEnabled(): boolean;
|
|
46
55
|
/**
|
|
47
56
|
* @returns app name value
|
|
48
57
|
*/
|
package/ContextHolder/index.js
CHANGED
|
@@ -11,6 +11,7 @@ export class ContextHolder {
|
|
|
11
11
|
|
|
12
12
|
this.entitlementsOptions = null;
|
|
13
13
|
this.appName = null;
|
|
14
|
+
this.sessionContext = void 0;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
static getInstance() {
|
|
@@ -55,6 +56,11 @@ export class ContextHolder {
|
|
|
55
56
|
ContextHolder.getInstance().entitlementsOptions = entitlementsOptions;
|
|
56
57
|
}
|
|
57
58
|
|
|
59
|
+
static setSessionContext(sessionContext) {
|
|
60
|
+
const instance = ContextHolder.getInstance();
|
|
61
|
+
instance.sessionContext = sessionContext;
|
|
62
|
+
}
|
|
63
|
+
|
|
58
64
|
static setAppName(appName) {
|
|
59
65
|
ContextHolder.getInstance().appName = appName;
|
|
60
66
|
}
|
|
@@ -95,6 +101,12 @@ export class ContextHolder {
|
|
|
95
101
|
return ((_ContextHolder$getIns2 = ContextHolder.getInstance().entitlementsOptions) == null ? void 0 : _ContextHolder$getIns2.enabled) || false;
|
|
96
102
|
}
|
|
97
103
|
|
|
104
|
+
static isSessionPerTenantEnabled() {
|
|
105
|
+
var _ContextHolder$getIns3;
|
|
106
|
+
|
|
107
|
+
return ((_ContextHolder$getIns3 = ContextHolder.getInstance().sessionContext) == null ? void 0 : _ContextHolder$getIns3.enableSessionPerTenant) || false;
|
|
108
|
+
}
|
|
109
|
+
|
|
98
110
|
static getAppName() {
|
|
99
111
|
return ContextHolder.getInstance().appName;
|
|
100
112
|
}
|
package/auth/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export * from "./secutiry-poilicy";
|
|
2
2
|
export * from "./enums";
|
|
3
|
+
export { setTabTenantInSessionStorage, getTabTenantFromSessionStorage } from './utils';
|
|
3
4
|
import { ISamlRolesGroup } from "../teams/interfaces";
|
|
4
|
-
import { IAcceptInvitation, IActivateAccount, IAllowedToRememberMfaDevice, ICreateSamlGroup, IDeleteApiToken, IDisableMfa, IEnrollMfaResponse, IForgotPassword, IGetActivateAccountStrategy, IGetActivateAccountStrategyResponse, IGetUserById, IGetUserPasswordConfig, ILogin, ILoginResponse, ILoginViaSocialLogin, ILoginViaSocialLoginResponse, ILoginWithMfa, IOidcPostLogin, IOidcConfiguration, IPostLogin, IPreLogin, IRecoverMFAToken, IResendActivationEmail, IResetPassword, ISamlConfiguration, ISamlVendorConfigResponse, ISignUpResponse, ISignUpUser, ISocialLoginProviderConfiguration, ITenantApiTokensData, IUpdateSamlConfiguration, IUpdateSamlGroup, IUpdateSamlRoles, IUpdateSamlVendorMetadata, IUpdateTenantApiTokensData, IUpdateUserApiTokensData, IUserApiTokensData, IUserIdResponse, IVendorConfig, IVerifyMfa, IVerifyMfaResponse, TestConfig, ISSOPublicConfiguration, IPreLoginWithIdpTypeResponse, IPasswordlessPreLogin, IPasswordlessPostLogin, ICreateSSODomain, IVerifyInviteToken, ISSODomain, ISSOConfigurationDefaultRoles, ISSOConfiguration, IUpdateSSOConfiguration, IOidcPostLoginV2, IExchangeOAuthTokens, IOAuthTokenResponse, ISocialLoginProviderConfigurationV2, ILoginResponseV2, IResetPhoneNumber, IVerifyResetPhoneNumber, IChangePhoneNumber, IVerifyResetPhoneNumberResponse, IResetPhoneNumberResponse, IWebAuthnPreLogin, IWebAuthnPostLogin, IVerifyNewWebAuthnDevice, IWebAuthnPreLoginResponse, ICreateNewDeviceSessionResponse, IAuthStrategiesConfig, ISessionResponse, IChangePhoneNumberWithVerification, IChangePhoneNumberWithVerificationResponse, IVerifyChangePhoneNumber, ISessionConfigurations, IResendInvitationEmail, IPreEnrollMFA, IEnrollMFAAuthenticatorApp, IPreEnrollMFASMS, IEnrollMFASMS, IEnrollMFAWebAuthn, IPreEnrollMFAAuthenticatorAppResponse, IPreEnrollMFAWebAuthnResponse, IVerifyMFAAuthenticatorApp, IPreVerifyMFA, IPreVerifyMFASMSResponse, IVerifyMFASMS, IPreVerifyMFAWebAuthnResponse, IVerifyMFAWebAuthn, IPreEnrollMFASMSResponse, IPreDisableMFASMSResponse, IDisableMFASMS, IDisableMFAWebAuthn, IPreDisableMFAWebAuthnResponse, UserMFADevicesResponse, WithoutMFAToken, IMFAStrategiesResponse, IOAuthLogout, IGetUserAccessTokens, IGetTenantAccessTokens, IDeleteAccessToken, ICreateTenantAccessTokenData, ICreateUserAccessTokenData, IWebAuthnDevices, ICustomSocialLoginProviderConfigurationV1, ILoginResponseV3, IPreVerifyMFAEmailCodeResponse, IVerifyMFAEmailCode, ICreateOrUpdateSSOConfigurationByMetadataUrl
|
|
5
|
+
import { IAcceptInvitation, IActivateAccount, IAllowedToRememberMfaDevice, ICreateSamlGroup, IDeleteApiToken, IDisableMfa, IEnrollMfaResponse, IForgotPassword, IGetActivateAccountStrategy, IGetActivateAccountStrategyResponse, IGetUserById, IGetUserPasswordConfig, ILogin, ILoginResponse, ILoginViaSocialLogin, ILoginViaSocialLoginResponse, ILoginWithMfa, IOidcPostLogin, IOidcConfiguration, IPostLogin, IPreLogin, IRecoverMFAToken, IResendActivationEmail, IResetPassword, ISamlConfiguration, ISamlVendorConfigResponse, ISignUpResponse, ISignUpUser, ISocialLoginProviderConfiguration, ITenantApiTokensData, IUpdateSamlConfiguration, IUpdateSamlGroup, IUpdateSamlRoles, IUpdateSamlVendorMetadata, IUpdateTenantApiTokensData, IUpdateUserApiTokensData, IUserApiTokensData, IUserIdResponse, IVendorConfig, IVerifyMfa, IVerifyMfaResponse, TestConfig, ISSOPublicConfiguration, IPreLoginWithIdpTypeResponse, IPasswordlessPreLogin, IPasswordlessPostLogin, ICreateSSODomain, IVerifyInviteToken, ISSODomain, ISSOConfigurationDefaultRoles, ISSOConfiguration, IUpdateSSOConfiguration, IOidcPostLoginV2, IExchangeOAuthTokens, IOAuthTokenResponse, ISocialLoginProviderConfigurationV2, ILoginResponseV2, IResetPhoneNumber, IVerifyResetPhoneNumber, IChangePhoneNumber, IVerifyResetPhoneNumberResponse, IResetPhoneNumberResponse, IWebAuthnPreLogin, IWebAuthnPostLogin, IVerifyNewWebAuthnDevice, IWebAuthnPreLoginResponse, ICreateNewDeviceSessionResponse, IAuthStrategiesConfig, ISessionResponse, IChangePhoneNumberWithVerification, IChangePhoneNumberWithVerificationResponse, IVerifyChangePhoneNumber, ISessionConfigurations, IResendInvitationEmail, IPreEnrollMFA, IEnrollMFAAuthenticatorApp, IPreEnrollMFASMS, IEnrollMFASMS, IEnrollMFAWebAuthn, IPreEnrollMFAAuthenticatorAppResponse, IPreEnrollMFAWebAuthnResponse, IVerifyMFAAuthenticatorApp, IPreVerifyMFA, IPreVerifyMFASMSResponse, IVerifyMFASMS, IPreVerifyMFAWebAuthnResponse, IVerifyMFAWebAuthn, IPreEnrollMFASMSResponse, IPreDisableMFASMSResponse, IDisableMFASMS, IDisableMFAWebAuthn, IPreDisableMFAWebAuthnResponse, UserMFADevicesResponse, WithoutMFAToken, IMFAStrategiesResponse, IOAuthLogout, IGetUserAccessTokens, IGetTenantAccessTokens, IDeleteAccessToken, ICreateTenantAccessTokenData, ICreateUserAccessTokenData, IWebAuthnDevices, ICustomSocialLoginProviderConfigurationV1, ILoginResponseV3, IPreVerifyMFAEmailCodeResponse, IVerifyMFAEmailCode, ICreateOrUpdateSSOConfigurationByMetadataUrl } from './interfaces';
|
|
5
6
|
import { IGetUserAuthorizationResponse, IUserProfile } from "../users/interfaces";
|
|
6
7
|
/*****************************************
|
|
7
8
|
* Authentication
|
|
@@ -112,17 +113,17 @@ export declare function acceptInvitation(body: IAcceptInvitation): Promise<void>
|
|
|
112
113
|
* refresh token called as authenticated use, access and refresh tokens resolved by the cookies.
|
|
113
114
|
* the server will return ILoginResponse with new access Token and refresh token and store it in the browser cookies.
|
|
114
115
|
*/
|
|
115
|
-
export declare function refreshToken(
|
|
116
|
+
export declare function refreshToken(): Promise<ILoginResponse>;
|
|
116
117
|
/**
|
|
117
118
|
* refresh token called as authenticated use, access and refresh tokens resolved by the cookies.
|
|
118
119
|
* the server will return ILoginResponseV2 with new access Token and refresh token and store it in the browser cookies, as well as the tenants.
|
|
119
120
|
*/
|
|
120
|
-
export declare function refreshTokenV2(
|
|
121
|
+
export declare function refreshTokenV2(): Promise<ILoginResponseV2>;
|
|
121
122
|
/**
|
|
122
123
|
* refresh token called as authenticated use, access and refresh tokens resolved by the cookies.
|
|
123
124
|
* the server will return ILoginResponseV3 with new access Token and refresh token and store it in the browser cookies, as well as the tenants and the active tenant.
|
|
124
125
|
*/
|
|
125
|
-
export declare function refreshTokenV3(
|
|
126
|
+
export declare function refreshTokenV3(): Promise<ILoginResponseV3>;
|
|
126
127
|
/**
|
|
127
128
|
* logout from server, invalidate access and refresh token, remove it from cookies.
|
|
128
129
|
*/
|
|
@@ -680,9 +681,9 @@ export declare function preLoginV2(body: IPreLogin): Promise<IPreLoginWithIdpTyp
|
|
|
680
681
|
*/
|
|
681
682
|
export declare function oidcPostLoginV2(body: IOidcPostLoginV2): Promise<ILoginResponse>;
|
|
682
683
|
export declare function exchangeOAuthTokensV2(body: IExchangeOAuthTokens): Promise<ILoginResponseV3>;
|
|
683
|
-
export declare function silentOAuthRefreshTokenV2(
|
|
684
|
+
export declare function silentOAuthRefreshTokenV2(): Promise<ILoginResponseV3>;
|
|
684
685
|
export declare function exchangeOAuthTokens(body: IExchangeOAuthTokens): Promise<ILoginResponse>;
|
|
685
|
-
export declare function silentOAuthRefreshToken(
|
|
686
|
+
export declare function silentOAuthRefreshToken(): Promise<ILoginResponse>;
|
|
686
687
|
/**
|
|
687
688
|
* reset phone should be called in case user want to reset his phone number
|
|
688
689
|
* when using sms authentication strategy. a 6-digits code will be send to the user email.
|
package/auth/index.js
CHANGED
|
@@ -6,16 +6,16 @@ const _excluded = ["type"],
|
|
|
6
6
|
import { getTenants } from "../tenants";
|
|
7
7
|
export * from "./secutiry-poilicy";
|
|
8
8
|
export * from "./enums";
|
|
9
|
+
export { setTabTenantInSessionStorage, getTabTenantFromSessionStorage } from './utils';
|
|
9
10
|
import { urls } from "../constants";
|
|
10
11
|
import { ContextHolder } from "../ContextHolder";
|
|
11
12
|
import { Delete, Get, Patch, Post, Put } from "../fetch";
|
|
12
13
|
import { jwtDecode } from "../jwt";
|
|
13
14
|
import { LOAD_AUTHORIZATION_FF } from './interfaces';
|
|
14
|
-
import { getCurrentUserTenantsV3 } from '../users';
|
|
15
15
|
import { loadEntitlements } from '../entitlements';
|
|
16
16
|
import { ADMIN_PORTAL_ENTITLEMENTS_FF } from '../entitlements/interfaces';
|
|
17
17
|
import { FeatureFlags } from "../feature-flags";
|
|
18
|
-
import { executeConditionalPromise } from "./utils";
|
|
18
|
+
import { executeConditionalPromise, getCurrentUserTenantsFunction, getTabTenantFromSessionStorage, setTabTenantInSessionStorage } from "./utils";
|
|
19
19
|
export async function generateLoginResponse(loginResponse) {
|
|
20
20
|
if (!loginResponse.accessToken) {
|
|
21
21
|
return loginResponse;
|
|
@@ -76,11 +76,15 @@ export async function generateLoginResponseV3(loginResponse) {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
ContextHolder.setAccessToken(accessToken);
|
|
79
|
-
const [me, currentUserTenants] = await Promise.all([getMeAndEntitlements(),
|
|
79
|
+
const [me, currentUserTenants] = await Promise.all([getMeAndEntitlements(), getCurrentUserTenantsFunction()()]);
|
|
80
80
|
const decodedContent = accessToken ? jwtDecode(accessToken) : {};
|
|
81
81
|
|
|
82
82
|
const user = _extends({}, loginResponse, decodedContent, me);
|
|
83
83
|
|
|
84
|
+
if (ContextHolder.isSessionPerTenantEnabled()) {
|
|
85
|
+
setTabTenantInSessionStorage(user.tenantId);
|
|
86
|
+
}
|
|
87
|
+
|
|
84
88
|
ContextHolder.setUser(user);
|
|
85
89
|
return {
|
|
86
90
|
user,
|
|
@@ -106,7 +110,7 @@ export async function generateLoginResponseFromOAuthResponse(oauthResponse) {
|
|
|
106
110
|
}
|
|
107
111
|
export async function generateLoginResponseFromOAuthResponseV2(oauthResponse) {
|
|
108
112
|
ContextHolder.setAccessToken(oauthResponse.id_token);
|
|
109
|
-
const [me, currentUserTenants] = await Promise.all([getMeAndEntitlements(),
|
|
113
|
+
const [me, currentUserTenants] = await Promise.all([getMeAndEntitlements(), getCurrentUserTenantsFunction()()]);
|
|
110
114
|
const decodedContent = oauthResponse.id_token ? jwtDecode(oauthResponse.id_token) : {};
|
|
111
115
|
|
|
112
116
|
const user = _extends({
|
|
@@ -117,6 +121,10 @@ export async function generateLoginResponseFromOAuthResponseV2(oauthResponse) {
|
|
|
117
121
|
expiresIn: oauthResponse.expires_in || 300
|
|
118
122
|
});
|
|
119
123
|
|
|
124
|
+
if (ContextHolder.isSessionPerTenantEnabled()) {
|
|
125
|
+
setTabTenantInSessionStorage(user.tenantId);
|
|
126
|
+
}
|
|
127
|
+
|
|
120
128
|
ContextHolder.setUser(user);
|
|
121
129
|
return {
|
|
122
130
|
user,
|
|
@@ -180,16 +188,25 @@ export async function resendInvitationEmail(body) {
|
|
|
180
188
|
export async function acceptInvitation(body) {
|
|
181
189
|
return Post(`${urls.identity.users.v1}/invitation/accept`, body);
|
|
182
190
|
}
|
|
183
|
-
export async function refreshToken(
|
|
184
|
-
const
|
|
191
|
+
export async function refreshToken() {
|
|
192
|
+
const tabTenantId = getTabTenantFromSessionStorage();
|
|
193
|
+
const data = await Post(`${urls.identity.auth.v1}/user/token/refresh`, {
|
|
194
|
+
tenantId: tabTenantId
|
|
195
|
+
});
|
|
185
196
|
return generateLoginResponse(data);
|
|
186
197
|
}
|
|
187
|
-
export async function refreshTokenV2(
|
|
188
|
-
const
|
|
198
|
+
export async function refreshTokenV2() {
|
|
199
|
+
const tabTenantId = getTabTenantFromSessionStorage();
|
|
200
|
+
const data = await Post(`${urls.identity.auth.v1}/user/token/refresh`, {
|
|
201
|
+
tenantId: tabTenantId
|
|
202
|
+
});
|
|
189
203
|
return generateLoginResponseV2(data);
|
|
190
204
|
}
|
|
191
|
-
export async function refreshTokenV3(
|
|
192
|
-
const
|
|
205
|
+
export async function refreshTokenV3() {
|
|
206
|
+
const tabTenantId = getTabTenantFromSessionStorage();
|
|
207
|
+
const data = await Post(`${urls.identity.auth.v1}/user/token/refresh`, {
|
|
208
|
+
tenantId: tabTenantId
|
|
209
|
+
});
|
|
193
210
|
return generateLoginResponseV3(data);
|
|
194
211
|
}
|
|
195
212
|
export async function logout() {
|
|
@@ -636,16 +653,22 @@ export async function exchangeOAuthTokensV2(body) {
|
|
|
636
653
|
const data = await Post(`${urls.oauth.v1}/token`, body);
|
|
637
654
|
return generateLoginResponseFromOAuthResponseV2(data);
|
|
638
655
|
}
|
|
639
|
-
export async function silentOAuthRefreshTokenV2(
|
|
640
|
-
const
|
|
656
|
+
export async function silentOAuthRefreshTokenV2() {
|
|
657
|
+
const tabTenantId = getTabTenantFromSessionStorage();
|
|
658
|
+
const data = await Post(`${urls.oauth.v1}/authorize/silent`, {
|
|
659
|
+
tenantId: tabTenantId
|
|
660
|
+
});
|
|
641
661
|
return generateLoginResponseFromOAuthResponseV2(data);
|
|
642
662
|
}
|
|
643
663
|
export async function exchangeOAuthTokens(body) {
|
|
644
664
|
const data = await Post(`${urls.oauth.v1}/token`, body);
|
|
645
665
|
return generateLoginResponseFromOAuthResponse(data);
|
|
646
666
|
}
|
|
647
|
-
export async function silentOAuthRefreshToken(
|
|
648
|
-
const
|
|
667
|
+
export async function silentOAuthRefreshToken() {
|
|
668
|
+
const tabTenantId = getTabTenantFromSessionStorage();
|
|
669
|
+
const data = await Post(`${urls.oauth.v1}/authorize/silent`, {
|
|
670
|
+
tenantId: tabTenantId
|
|
671
|
+
});
|
|
649
672
|
return generateLoginResponseFromOAuthResponse(data);
|
|
650
673
|
}
|
|
651
674
|
export async function resetPhoneNumber(body) {
|
|
@@ -713,6 +736,12 @@ export async function getMeAndEntitlements() {
|
|
|
713
736
|
}];
|
|
714
737
|
const promises = actions.map(action => executeConditionalPromise(action));
|
|
715
738
|
const [me, entitlements, authorization] = await Promise.all(promises);
|
|
739
|
+
const tabTenant = getTabTenantFromSessionStorage();
|
|
740
|
+
|
|
741
|
+
if (tabTenant) {
|
|
742
|
+
me.tenantId = tabTenant;
|
|
743
|
+
}
|
|
744
|
+
|
|
716
745
|
return _extends({}, me, authorization != null ? authorization : {}, {
|
|
717
746
|
entitlements
|
|
718
747
|
});
|
package/auth/interfaces.d.ts
CHANGED
|
@@ -30,9 +30,6 @@ export declare type ILogin = {
|
|
|
30
30
|
recaptchaToken?: string;
|
|
31
31
|
invitationToken?: string;
|
|
32
32
|
};
|
|
33
|
-
export declare type IRefreshToken = {
|
|
34
|
-
tenantId?: string;
|
|
35
|
-
};
|
|
36
33
|
export declare type ILoginResponse = IUserProfile & {
|
|
37
34
|
mfaRequired: boolean;
|
|
38
35
|
accessToken: string;
|
package/auth/utils.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { GetCurrentUserTenantsResponse } from '../users/interfaces';
|
|
1
2
|
export interface ConditionalAction<T = any> {
|
|
2
3
|
action: () => Promise<T>;
|
|
3
4
|
shouldLoad: boolean;
|
|
4
5
|
}
|
|
5
6
|
export declare function executeConditionalPromise({ shouldLoad, action }: ConditionalAction): Promise<any>;
|
|
7
|
+
export declare function setTabTenantInSessionStorage(tenantId: string): void;
|
|
8
|
+
export declare function getTabTenantFromSessionStorage(): string | null;
|
|
9
|
+
export declare function getCurrentUserTenantsFunction(): () => Promise<GetCurrentUserTenantsResponse>;
|
package/auth/utils.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { ContextHolder } from '../ContextHolder';
|
|
2
|
+
import { USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF } from './constants';
|
|
3
|
+
import { FeatureFlags } from '../feature-flags';
|
|
4
|
+
import { getCurrentUserTenantsV1, getCurrentUserTenantsV3 } from '../users';
|
|
5
|
+
import { FRONTEGG_SEPARATE_TABS_BY_TENANT } from './constants';
|
|
1
6
|
;
|
|
2
7
|
export async function executeConditionalPromise({
|
|
3
8
|
shouldLoad,
|
|
@@ -5,4 +10,27 @@ export async function executeConditionalPromise({
|
|
|
5
10
|
}) {
|
|
6
11
|
if (!shouldLoad) return;
|
|
7
12
|
return await action();
|
|
13
|
+
}
|
|
14
|
+
export function setTabTenantInSessionStorage(tenantId) {
|
|
15
|
+
if (!tenantId) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
sessionStorage.setItem(FRONTEGG_SEPARATE_TABS_BY_TENANT, tenantId);
|
|
20
|
+
}
|
|
21
|
+
export function getTabTenantFromSessionStorage() {
|
|
22
|
+
if (ContextHolder.isSessionPerTenantEnabled()) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return sessionStorage.getItem(FRONTEGG_SEPARATE_TABS_BY_TENANT);
|
|
27
|
+
}
|
|
28
|
+
export function getCurrentUserTenantsFunction() {
|
|
29
|
+
const [useCurrentUserTenantsV1] = FeatureFlags.getFeatureFlags([USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF], ContextHolder.getAppName() || '');
|
|
30
|
+
|
|
31
|
+
if (ContextHolder.isSessionPerTenantEnabled()) {
|
|
32
|
+
return getCurrentUserTenantsV1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return useCurrentUserTenantsV1 ? getCurrentUserTenantsV1 : getCurrentUserTenantsV3;
|
|
8
36
|
}
|
package/constants.d.ts
CHANGED
package/constants.js
CHANGED
package/index.js
CHANGED
package/interfaces.d.ts
CHANGED
|
@@ -54,6 +54,9 @@ export interface MetadataHeaders {
|
|
|
54
54
|
framework?: FronteggFrameworks;
|
|
55
55
|
fronteggSdkVersion?: string;
|
|
56
56
|
}
|
|
57
|
+
export interface SessionContext {
|
|
58
|
+
enableSessionPerTenant?: boolean;
|
|
59
|
+
}
|
|
57
60
|
export interface ContextOptions {
|
|
58
61
|
baseUrl: string | ((url: string) => string);
|
|
59
62
|
clientId?: string;
|
|
@@ -18,6 +18,7 @@ class ContextHolder {
|
|
|
18
18
|
|
|
19
19
|
this.entitlementsOptions = null;
|
|
20
20
|
this.appName = null;
|
|
21
|
+
this.sessionContext = void 0;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
static getInstance() {
|
|
@@ -62,6 +63,11 @@ class ContextHolder {
|
|
|
62
63
|
ContextHolder.getInstance().entitlementsOptions = entitlementsOptions;
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
static setSessionContext(sessionContext) {
|
|
67
|
+
const instance = ContextHolder.getInstance();
|
|
68
|
+
instance.sessionContext = sessionContext;
|
|
69
|
+
}
|
|
70
|
+
|
|
65
71
|
static setAppName(appName) {
|
|
66
72
|
ContextHolder.getInstance().appName = appName;
|
|
67
73
|
}
|
|
@@ -102,6 +108,12 @@ class ContextHolder {
|
|
|
102
108
|
return ((_ContextHolder$getIns2 = ContextHolder.getInstance().entitlementsOptions) == null ? void 0 : _ContextHolder$getIns2.enabled) || false;
|
|
103
109
|
}
|
|
104
110
|
|
|
111
|
+
static isSessionPerTenantEnabled() {
|
|
112
|
+
var _ContextHolder$getIns3;
|
|
113
|
+
|
|
114
|
+
return ((_ContextHolder$getIns3 = ContextHolder.getInstance().sessionContext) == null ? void 0 : _ContextHolder$getIns3.enableSessionPerTenant) || false;
|
|
115
|
+
}
|
|
116
|
+
|
|
105
117
|
static getAppName() {
|
|
106
118
|
return ContextHolder.getInstance().appName;
|
|
107
119
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF = exports.FRONTEGG_SEPARATE_TABS_BY_TENANT = void 0;
|
|
7
|
+
const FRONTEGG_SEPARATE_TABS_BY_TENANT = 'FRONTEGG_SEPARATE_TABS_BY_TENANT';
|
|
8
|
+
exports.FRONTEGG_SEPARATE_TABS_BY_TENANT = FRONTEGG_SEPARATE_TABS_BY_TENANT;
|
|
9
|
+
const USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF = 'admin_portal_use_current_user_tenants_v1_endpoint';
|
|
10
|
+
exports.USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF = USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF;
|
package/node/auth/index.js
CHANGED
|
@@ -153,7 +153,9 @@ var _exportNames = {
|
|
|
153
153
|
getMFAStrategiesConfig: true,
|
|
154
154
|
getUserAuthorization: true,
|
|
155
155
|
getMeV2: true,
|
|
156
|
-
getMeAndEntitlements: true
|
|
156
|
+
getMeAndEntitlements: true,
|
|
157
|
+
setTabTenantInSessionStorage: true,
|
|
158
|
+
getTabTenantFromSessionStorage: true
|
|
157
159
|
};
|
|
158
160
|
exports.OAuthLogout = OAuthLogout;
|
|
159
161
|
exports.acceptInvitation = acceptInvitation;
|
|
@@ -226,6 +228,12 @@ exports.getSessionConfigurations = getSessionConfigurations;
|
|
|
226
228
|
exports.getSocialLoginProviders = getSocialLoginProviders;
|
|
227
229
|
exports.getSocialLoginProvidersV2 = getSocialLoginProvidersV2;
|
|
228
230
|
exports.getSocialLoginProvidersV2ForAuthenticatedUser = getSocialLoginProvidersV2ForAuthenticatedUser;
|
|
231
|
+
Object.defineProperty(exports, "getTabTenantFromSessionStorage", {
|
|
232
|
+
enumerable: true,
|
|
233
|
+
get: function () {
|
|
234
|
+
return _utils.getTabTenantFromSessionStorage;
|
|
235
|
+
}
|
|
236
|
+
});
|
|
229
237
|
exports.getTenantAccessTokensData = getTenantAccessTokensData;
|
|
230
238
|
exports.getTenantApiTokensData = getTenantApiTokensData;
|
|
231
239
|
exports.getUserAccessTokensData = getUserAccessTokensData;
|
|
@@ -272,6 +280,12 @@ exports.resetPassword = resetPassword;
|
|
|
272
280
|
exports.resetPhoneNumber = resetPhoneNumber;
|
|
273
281
|
exports.revokeSessionsForUser = revokeSessionsForUser;
|
|
274
282
|
exports.setSSODefaultRoles = setSSODefaultRoles;
|
|
283
|
+
Object.defineProperty(exports, "setTabTenantInSessionStorage", {
|
|
284
|
+
enumerable: true,
|
|
285
|
+
get: function () {
|
|
286
|
+
return _utils.setTabTenantInSessionStorage;
|
|
287
|
+
}
|
|
288
|
+
});
|
|
275
289
|
exports.signUpUser = signUpUser;
|
|
276
290
|
exports.silentOAuthRefreshToken = silentOAuthRefreshToken;
|
|
277
291
|
exports.silentOAuthRefreshTokenV2 = silentOAuthRefreshTokenV2;
|
|
@@ -338,6 +352,8 @@ Object.keys(_enums).forEach(function (key) {
|
|
|
338
352
|
});
|
|
339
353
|
});
|
|
340
354
|
|
|
355
|
+
var _utils = require("./utils");
|
|
356
|
+
|
|
341
357
|
var _constants = require("../constants");
|
|
342
358
|
|
|
343
359
|
var _ContextHolder = require("../ContextHolder");
|
|
@@ -348,16 +364,12 @@ var _jwt = require("../jwt");
|
|
|
348
364
|
|
|
349
365
|
var _interfaces = require("./interfaces");
|
|
350
366
|
|
|
351
|
-
var _users = require("../users");
|
|
352
|
-
|
|
353
367
|
var _entitlements = require("../entitlements");
|
|
354
368
|
|
|
355
369
|
var _interfaces2 = require("../entitlements/interfaces");
|
|
356
370
|
|
|
357
371
|
var _featureFlags = require("../feature-flags");
|
|
358
372
|
|
|
359
|
-
var _utils = require("./utils");
|
|
360
|
-
|
|
361
373
|
const _excluded = ["type"],
|
|
362
374
|
_excluded2 = ["type"],
|
|
363
375
|
_excluded3 = ["type"];
|
|
@@ -428,10 +440,14 @@ async function generateLoginResponseV3(loginResponse) {
|
|
|
428
440
|
|
|
429
441
|
_ContextHolder.ContextHolder.setAccessToken(accessToken);
|
|
430
442
|
|
|
431
|
-
const [me, currentUserTenants] = await Promise.all([getMeAndEntitlements(), (0,
|
|
443
|
+
const [me, currentUserTenants] = await Promise.all([getMeAndEntitlements(), (0, _utils.getCurrentUserTenantsFunction)()()]);
|
|
432
444
|
const decodedContent = accessToken ? (0, _jwt.jwtDecode)(accessToken) : {};
|
|
433
445
|
const user = (0, _extends2.default)({}, loginResponse, decodedContent, me);
|
|
434
446
|
|
|
447
|
+
if (_ContextHolder.ContextHolder.isSessionPerTenantEnabled()) {
|
|
448
|
+
(0, _utils.setTabTenantInSessionStorage)(user.tenantId);
|
|
449
|
+
}
|
|
450
|
+
|
|
435
451
|
_ContextHolder.ContextHolder.setUser(user);
|
|
436
452
|
|
|
437
453
|
return {
|
|
@@ -462,7 +478,7 @@ async function generateLoginResponseFromOAuthResponse(oauthResponse) {
|
|
|
462
478
|
async function generateLoginResponseFromOAuthResponseV2(oauthResponse) {
|
|
463
479
|
_ContextHolder.ContextHolder.setAccessToken(oauthResponse.id_token);
|
|
464
480
|
|
|
465
|
-
const [me, currentUserTenants] = await Promise.all([getMeAndEntitlements(), (0,
|
|
481
|
+
const [me, currentUserTenants] = await Promise.all([getMeAndEntitlements(), (0, _utils.getCurrentUserTenantsFunction)()()]);
|
|
466
482
|
const decodedContent = oauthResponse.id_token ? (0, _jwt.jwtDecode)(oauthResponse.id_token) : {};
|
|
467
483
|
const user = (0, _extends2.default)({
|
|
468
484
|
mfaRequired: false,
|
|
@@ -472,6 +488,10 @@ async function generateLoginResponseFromOAuthResponseV2(oauthResponse) {
|
|
|
472
488
|
expiresIn: oauthResponse.expires_in || 300
|
|
473
489
|
});
|
|
474
490
|
|
|
491
|
+
if (_ContextHolder.ContextHolder.isSessionPerTenantEnabled()) {
|
|
492
|
+
(0, _utils.setTabTenantInSessionStorage)(user.tenantId);
|
|
493
|
+
}
|
|
494
|
+
|
|
475
495
|
_ContextHolder.ContextHolder.setUser(user);
|
|
476
496
|
|
|
477
497
|
return {
|
|
@@ -551,18 +571,27 @@ async function acceptInvitation(body) {
|
|
|
551
571
|
return (0, _fetch.Post)(`${_constants.urls.identity.users.v1}/invitation/accept`, body);
|
|
552
572
|
}
|
|
553
573
|
|
|
554
|
-
async function refreshToken(
|
|
555
|
-
const
|
|
574
|
+
async function refreshToken() {
|
|
575
|
+
const tabTenantId = (0, _utils.getTabTenantFromSessionStorage)();
|
|
576
|
+
const data = await (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/token/refresh`, {
|
|
577
|
+
tenantId: tabTenantId
|
|
578
|
+
});
|
|
556
579
|
return generateLoginResponse(data);
|
|
557
580
|
}
|
|
558
581
|
|
|
559
|
-
async function refreshTokenV2(
|
|
560
|
-
const
|
|
582
|
+
async function refreshTokenV2() {
|
|
583
|
+
const tabTenantId = (0, _utils.getTabTenantFromSessionStorage)();
|
|
584
|
+
const data = await (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/token/refresh`, {
|
|
585
|
+
tenantId: tabTenantId
|
|
586
|
+
});
|
|
561
587
|
return generateLoginResponseV2(data);
|
|
562
588
|
}
|
|
563
589
|
|
|
564
|
-
async function refreshTokenV3(
|
|
565
|
-
const
|
|
590
|
+
async function refreshTokenV3() {
|
|
591
|
+
const tabTenantId = (0, _utils.getTabTenantFromSessionStorage)();
|
|
592
|
+
const data = await (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/token/refresh`, {
|
|
593
|
+
tenantId: tabTenantId
|
|
594
|
+
});
|
|
566
595
|
return generateLoginResponseV3(data);
|
|
567
596
|
}
|
|
568
597
|
|
|
@@ -1112,8 +1141,11 @@ async function exchangeOAuthTokensV2(body) {
|
|
|
1112
1141
|
return generateLoginResponseFromOAuthResponseV2(data);
|
|
1113
1142
|
}
|
|
1114
1143
|
|
|
1115
|
-
async function silentOAuthRefreshTokenV2(
|
|
1116
|
-
const
|
|
1144
|
+
async function silentOAuthRefreshTokenV2() {
|
|
1145
|
+
const tabTenantId = (0, _utils.getTabTenantFromSessionStorage)();
|
|
1146
|
+
const data = await (0, _fetch.Post)(`${_constants.urls.oauth.v1}/authorize/silent`, {
|
|
1147
|
+
tenantId: tabTenantId
|
|
1148
|
+
});
|
|
1117
1149
|
return generateLoginResponseFromOAuthResponseV2(data);
|
|
1118
1150
|
}
|
|
1119
1151
|
|
|
@@ -1122,8 +1154,11 @@ async function exchangeOAuthTokens(body) {
|
|
|
1122
1154
|
return generateLoginResponseFromOAuthResponse(data);
|
|
1123
1155
|
}
|
|
1124
1156
|
|
|
1125
|
-
async function silentOAuthRefreshToken(
|
|
1126
|
-
const
|
|
1157
|
+
async function silentOAuthRefreshToken() {
|
|
1158
|
+
const tabTenantId = (0, _utils.getTabTenantFromSessionStorage)();
|
|
1159
|
+
const data = await (0, _fetch.Post)(`${_constants.urls.oauth.v1}/authorize/silent`, {
|
|
1160
|
+
tenantId: tabTenantId
|
|
1161
|
+
});
|
|
1127
1162
|
return generateLoginResponseFromOAuthResponse(data);
|
|
1128
1163
|
}
|
|
1129
1164
|
|
|
@@ -1209,6 +1244,12 @@ async function getMeAndEntitlements() {
|
|
|
1209
1244
|
}];
|
|
1210
1245
|
const promises = actions.map(action => (0, _utils.executeConditionalPromise)(action));
|
|
1211
1246
|
const [me, entitlements, authorization] = await Promise.all(promises);
|
|
1247
|
+
const tabTenant = (0, _utils.getTabTenantFromSessionStorage)();
|
|
1248
|
+
|
|
1249
|
+
if (tabTenant) {
|
|
1250
|
+
me.tenantId = tabTenant;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1212
1253
|
return (0, _extends2.default)({}, me, authorization != null ? authorization : {}, {
|
|
1213
1254
|
entitlements
|
|
1214
1255
|
});
|
package/node/auth/utils.js
CHANGED
|
@@ -4,6 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.executeConditionalPromise = executeConditionalPromise;
|
|
7
|
+
exports.getCurrentUserTenantsFunction = getCurrentUserTenantsFunction;
|
|
8
|
+
exports.getTabTenantFromSessionStorage = getTabTenantFromSessionStorage;
|
|
9
|
+
exports.setTabTenantInSessionStorage = setTabTenantInSessionStorage;
|
|
10
|
+
|
|
11
|
+
var _ContextHolder = require("../ContextHolder");
|
|
12
|
+
|
|
13
|
+
var _constants = require("./constants");
|
|
14
|
+
|
|
15
|
+
var _featureFlags = require("../feature-flags");
|
|
16
|
+
|
|
17
|
+
var _users = require("../users");
|
|
18
|
+
|
|
7
19
|
;
|
|
8
20
|
|
|
9
21
|
async function executeConditionalPromise({
|
|
@@ -12,4 +24,30 @@ async function executeConditionalPromise({
|
|
|
12
24
|
}) {
|
|
13
25
|
if (!shouldLoad) return;
|
|
14
26
|
return await action();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function setTabTenantInSessionStorage(tenantId) {
|
|
30
|
+
if (!tenantId) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
sessionStorage.setItem(_constants.FRONTEGG_SEPARATE_TABS_BY_TENANT, tenantId);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function getTabTenantFromSessionStorage() {
|
|
38
|
+
if (_ContextHolder.ContextHolder.isSessionPerTenantEnabled()) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return sessionStorage.getItem(_constants.FRONTEGG_SEPARATE_TABS_BY_TENANT);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function getCurrentUserTenantsFunction() {
|
|
46
|
+
const [useCurrentUserTenantsV1] = _featureFlags.FeatureFlags.getFeatureFlags([_constants.USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF], _ContextHolder.ContextHolder.getAppName() || '');
|
|
47
|
+
|
|
48
|
+
if (_ContextHolder.ContextHolder.isSessionPerTenantEnabled()) {
|
|
49
|
+
return _users.getCurrentUserTenantsV1;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return useCurrentUserTenantsV1 ? _users.getCurrentUserTenantsV1 : _users.getCurrentUserTenantsV3;
|
|
15
53
|
}
|
package/node/constants.js
CHANGED
package/node/index.js
CHANGED
package/node/tenants/index.js
CHANGED
|
@@ -21,7 +21,15 @@ var _fetch = require("../fetch");
|
|
|
21
21
|
|
|
22
22
|
var _constants = require("../constants");
|
|
23
23
|
|
|
24
|
+
var _utils = require("../auth/utils");
|
|
25
|
+
|
|
26
|
+
var _ContextHolder = require("../ContextHolder");
|
|
27
|
+
|
|
24
28
|
async function switchTenant(body) {
|
|
29
|
+
if (_ContextHolder.ContextHolder.isSessionPerTenantEnabled()) {
|
|
30
|
+
(0, _utils.setTabTenantInSessionStorage)(body.tenantId);
|
|
31
|
+
}
|
|
32
|
+
|
|
25
33
|
return (0, _fetch.Put)(`${_constants.urls.identity.users.v1}/tenant`, body);
|
|
26
34
|
}
|
|
27
35
|
|
package/node/users/index.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.GetUserJwt = GetUserJwt;
|
|
9
|
+
exports.getCurrentUserTenantsV1 = getCurrentUserTenantsV1;
|
|
9
10
|
exports.getCurrentUserTenantsV3 = getCurrentUserTenantsV3;
|
|
10
11
|
exports.getUsersGroups = getUsersGroups;
|
|
11
12
|
exports.getUsersRoles = getUsersRoles;
|
|
@@ -58,6 +59,12 @@ async function getCurrentUserTenantsV3(options) {
|
|
|
58
59
|
});
|
|
59
60
|
}
|
|
60
61
|
|
|
62
|
+
async function getCurrentUserTenantsV1(options) {
|
|
63
|
+
return (0, _fetch.Get)(_constants.urls.identity.users.tenants.me.v1, undefined, {
|
|
64
|
+
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
61
68
|
async function sendResetBreachedPasswordEmails() {
|
|
62
69
|
return (0, _fetch.Post)(_constants.urls.identity.users.passwords.resetBreachedPasswords.v1);
|
|
63
70
|
}
|
package/package.json
CHANGED
package/tenants/index.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { extractHeadersFromOptions, Get, Post, Put } from "../fetch";
|
|
3
3
|
import { urls } from "../constants";
|
|
4
|
+
import { setTabTenantInSessionStorage } from '../auth/utils';
|
|
5
|
+
import { ContextHolder } from '../ContextHolder';
|
|
4
6
|
export async function switchTenant(body) {
|
|
7
|
+
if (ContextHolder.isSessionPerTenantEnabled()) {
|
|
8
|
+
setTabTenantInSessionStorage(body.tenantId);
|
|
9
|
+
}
|
|
10
|
+
|
|
5
11
|
return Put(`${urls.identity.users.v1}/tenant`, body);
|
|
6
12
|
}
|
|
7
13
|
export async function getTenants() {
|
package/users/index.d.ts
CHANGED
|
@@ -5,6 +5,13 @@ export declare function getUsersV2(queryParams: ISearchUserQueryParamsV2, option
|
|
|
5
5
|
export declare function getUsersV3(queryParams: ISearchUserQueryParamsV3, options?: UserJwtOptions): Promise<FronteggPaginationWrapper<IUsersV3Data>>;
|
|
6
6
|
export declare function getUsersRoles(queryParams: GetUsersRolesParams, options?: UserJwtOptions): Promise<GetUserRolesResponse[]>;
|
|
7
7
|
export declare function getUsersGroups(queryParams: GetUserGroupsParams, options?: UserJwtOptions): Promise<GetUserGroupsResponse[]>;
|
|
8
|
+
/**
|
|
9
|
+
* get user tenant and user tenants by user active tenant
|
|
10
|
+
*/
|
|
8
11
|
export declare function getCurrentUserTenantsV3(options?: UserJwtOptions): Promise<GetCurrentUserTenantsResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* get user tenant and user tenants by context tenant
|
|
14
|
+
*/
|
|
15
|
+
export declare function getCurrentUserTenantsV1(options?: UserJwtOptions): Promise<GetCurrentUserTenantsResponse>;
|
|
9
16
|
export declare function sendResetBreachedPasswordEmails(): Promise<void>;
|
|
10
17
|
export declare function updateUserProfileV2(body: Partial<IUpdateUserDto>): Promise<IUserProfile>;
|
package/users/index.js
CHANGED
|
@@ -33,6 +33,11 @@ export async function getCurrentUserTenantsV3(options) {
|
|
|
33
33
|
headers: extractHeadersFromOptions(options)
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
+
export async function getCurrentUserTenantsV1(options) {
|
|
37
|
+
return Get(urls.identity.users.tenants.me.v1, undefined, {
|
|
38
|
+
headers: extractHeadersFromOptions(options)
|
|
39
|
+
});
|
|
40
|
+
}
|
|
36
41
|
export async function sendResetBreachedPasswordEmails() {
|
|
37
42
|
return Post(urls.identity.users.passwords.resetBreachedPasswords.v1);
|
|
38
43
|
}
|