@ngx-smz/core 21.10.0-next.20 → 21.10.0-next.22
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.
|
@@ -12039,7 +12039,12 @@ let AuthenticationState = class AuthenticationState {
|
|
|
12039
12039
|
onSwitchTenant(ctx, action) {
|
|
12040
12040
|
return this.authenticationService.switchTenant(action.data).pipe(tap$1((result) => {
|
|
12041
12041
|
ctx.dispatch(new AuthenticationActions.RemoteLoginSuccess(result.accessToken, result.refreshToken));
|
|
12042
|
-
|
|
12042
|
+
if (GlobalInjector.config.rbkUtils.authentication.keepRouteOnTenantSwitch) {
|
|
12043
|
+
window.location.reload();
|
|
12044
|
+
}
|
|
12045
|
+
else {
|
|
12046
|
+
window.location.href = '';
|
|
12047
|
+
}
|
|
12043
12048
|
}));
|
|
12044
12049
|
}
|
|
12045
12050
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: AuthenticationState, deps: [{ token: AuthService }, { token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -50060,6 +50065,11 @@ class SmzUiAuthenticationLoginBuilder extends SmzBuilderUtilities {
|
|
|
50060
50065
|
this._state.rbkUtils.authentication.accessTokenClaims.push({ claimName: 'allowed-tenants', propertyName: 'allowedTenants', type: 'array' });
|
|
50061
50066
|
return this.that;
|
|
50062
50067
|
}
|
|
50068
|
+
/** After switching tenant, reloads the page keeping the current route instead of going back to the root. Use together with allowTenantSwitching(). */
|
|
50069
|
+
keepRouteOnTenantSwitch() {
|
|
50070
|
+
this._state.rbkUtils.authentication.keepRouteOnTenantSwitch = true;
|
|
50071
|
+
return this.that;
|
|
50072
|
+
}
|
|
50063
50073
|
addToLoginPayload(property, value) {
|
|
50064
50074
|
Reflect.set(this._state.rbkUtils.authentication.refreshToken.extraProperties, property, value);
|
|
50065
50075
|
return this.that;
|
|
@@ -51225,6 +51235,7 @@ class SmzUiBuilder extends SmzBuilderUtilities {
|
|
|
51225
51235
|
allowSuperuser: false,
|
|
51226
51236
|
useSingleTenantAplication: false,
|
|
51227
51237
|
allowTenantSwitching: false,
|
|
51238
|
+
keepRouteOnTenantSwitch: false,
|
|
51228
51239
|
login: {
|
|
51229
51240
|
route: 'login',
|
|
51230
51241
|
errorHandlingType: 'toast',
|