handled tenant change across open tabs.
This commit is contained in:
parent
8940394aa5
commit
050a72e8c7
|
@ -16,6 +16,7 @@ import { ConfigurationService } from '../configuration/configuration.service';
|
|||
import { PrincipalService } from '../http/principal.service';
|
||||
import { BaseHttpParams } from '@common/http/base-http-params';
|
||||
import { InterceptorType } from '@common/http/interceptors/interceptor-type';
|
||||
import { TenantHandlingService } from '../tenant/tenant-handling.service';
|
||||
|
||||
export interface ResolutionContext {
|
||||
roles: AppRole[];
|
||||
|
@ -48,7 +49,8 @@ export class AuthService extends BaseService {
|
|||
private zone: NgZone,
|
||||
private keycloakService: KeycloakService,
|
||||
private uiNotificationService: UiNotificationService,
|
||||
private principalService: PrincipalService
|
||||
private principalService: PrincipalService,
|
||||
private tenantHandlingService: TenantHandlingService,
|
||||
) {
|
||||
super();
|
||||
|
||||
|
@ -67,6 +69,13 @@ export class AuthService extends BaseService {
|
|||
this.router.navigate(['/unauthorized'], {
|
||||
queryParams: { returnUrl: this.router.url },
|
||||
});
|
||||
} else if (
|
||||
event.key &&
|
||||
event.key === 'selectedTenant' &&
|
||||
event.newValue != this.selectedTenant()
|
||||
) {
|
||||
this.selectedTenant(event.newValue);
|
||||
window.location.href = this.tenantHandlingService.getCurrentUrlEnrichedWithTenantCode(event.newValue, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue