ui unauth fix
This commit is contained in:
parent
6173f088ed
commit
2283f95a5f
|
@ -111,6 +111,8 @@ export function InstallationConfigurationFactory(appConfig: ConfigurationService
|
||||||
const tenantCode = tenantHandlingService.extractTenantCodeFromUrlPath(window.location.pathname) ?? authService.selectedTenant() ?? 'default';
|
const tenantCode = tenantHandlingService.extractTenantCodeFromUrlPath(window.location.pathname) ?? authService.selectedTenant() ?? 'default';
|
||||||
const token = keycloak.getToken();
|
const token = keycloak.getToken();
|
||||||
return authService.prepareAuthRequest(from(token), tenantCode, { params }).toPromise().catch(error => {
|
return authService.prepareAuthRequest(from(token), tenantCode, { params }).toPromise().catch(error => {
|
||||||
|
if (!authService.isKeycloakLoggedIn()) return;
|
||||||
|
|
||||||
authService.onAuthenticateError(error);
|
authService.onAuthenticateError(error);
|
||||||
router.navigate(['/']);
|
router.navigate(['/']);
|
||||||
});
|
});
|
||||||
|
|
|
@ -167,6 +167,9 @@ export class AuthService extends BaseService {
|
||||||
public isLoggedIn(): boolean {
|
public isLoggedIn(): boolean {
|
||||||
return this.authState();
|
return this.authState();
|
||||||
}
|
}
|
||||||
|
public isKeycloakLoggedIn(): boolean {
|
||||||
|
return this.keycloakService.isLoggedIn();
|
||||||
|
}
|
||||||
public prepareAuthRequest(observable: Observable<string>, tenantCode: string, httpParams?: Object): Observable<boolean> {
|
public prepareAuthRequest(observable: Observable<string>, tenantCode: string, httpParams?: Object): Observable<boolean> {
|
||||||
return observable.pipe(
|
return observable.pipe(
|
||||||
map((x) => this.currentAuthenticationToken(x)),
|
map((x) => this.currentAuthenticationToken(x)),
|
||||||
|
|
Loading…
Reference in New Issue