Merge branch 'dmp-refactoring' of https://code-repo.d4science.org/MaDgiK-CITE/argos into dmp-refactoring
This commit is contained in:
commit
55b7817ae1
|
@ -12,7 +12,7 @@ import { Guid } from '@common/types/guid';
|
|||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { KeycloakEventType, KeycloakService } from 'keycloak-angular';
|
||||
import { Observable, Subject, forkJoin, from, of } from 'rxjs';
|
||||
import { exhaustMap, map, takeUntil } from 'rxjs/operators';
|
||||
import { concatMap, exhaustMap, map, takeUntil } from 'rxjs/operators';
|
||||
import { ConfigurationService } from '../configuration/configuration.service';
|
||||
import { PrincipalService } from '../http/principal.service';
|
||||
import { TenantHandlingService } from '../tenant/tenant-handling.service';
|
||||
|
@ -170,13 +170,17 @@ export class AuthService extends BaseService {
|
|||
public prepareAuthRequest(observable: Observable<string>, tenantCode: string, httpParams?: Object): Observable<boolean> {
|
||||
return observable.pipe(
|
||||
map((x) => this.currentAuthenticationToken(x)),
|
||||
exhaustMap(() => forkJoin([
|
||||
this.accessToken ? this.ensureTenant(tenantCode ?? this.selectedTenant() ?? 'default') : of(false),
|
||||
this.accessToken ? this.principalService.me(httpParams) : of(null),
|
||||
this.accessToken ? this.tenantHandlingService.loadTenantCssColors() : of(null),
|
||||
])),
|
||||
concatMap(response => {
|
||||
return this.accessToken ? this.ensureTenant(tenantCode ?? this.selectedTenant() ?? 'default') : of(false);
|
||||
}),
|
||||
concatMap(response => {
|
||||
return this.accessToken ? this.principalService.me(httpParams) : of(null);
|
||||
}),
|
||||
concatMap(response => {
|
||||
this.currentAccount(response);
|
||||
return this.accessToken ? this.tenantHandlingService.loadTenantCssColors() : of(null);
|
||||
}),
|
||||
map((item) => {
|
||||
this.currentAccount(item[1]);
|
||||
this.tenantHandlingService.applyTenantCssColors(item[2]?.cssColors);
|
||||
return true;
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue