mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
IPad fIx test 2
This commit is contained in:
@@ -94,9 +94,9 @@ export class AuthService {
|
||||
|
||||
async logout() {
|
||||
await this._oAuthService.revokeTokenAndLogout();
|
||||
asapScheduler.schedule(() => {
|
||||
window.location.reload();
|
||||
}, 250);
|
||||
// asapScheduler.schedule(() => {
|
||||
// window.location.reload();
|
||||
// }, 250);
|
||||
}
|
||||
|
||||
hasRole(role: string | string[]) {
|
||||
|
||||
@@ -143,11 +143,9 @@ export class AppComponent implements OnInit {
|
||||
title: 'Sie sind nicht mehr angemeldet',
|
||||
data: { message: 'Sie werden neu angemeldet' },
|
||||
})
|
||||
.afterClosed$.pipe(
|
||||
tap(() => {
|
||||
this._authService.logout();
|
||||
})
|
||||
);
|
||||
.afterClosed$.subscribe(() => {
|
||||
this._authService.login();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpInterceptor, HttpEvent, HttpHandler, HttpRequest, HttpErrorResponse } from '@angular/common/http';
|
||||
import { Observable, throwError } from 'rxjs';
|
||||
import { NEVER, Observable, throwError } from 'rxjs';
|
||||
import { UiMessageModalComponent, UiModalService } from '@ui/modal';
|
||||
import { catchError, mergeMap, tap } from 'rxjs/operators';
|
||||
import { AuthService } from '@core/auth';
|
||||
@@ -25,6 +25,7 @@ export class HttpErrorInterceptor implements HttpInterceptor {
|
||||
})
|
||||
.afterClosed$.pipe(mergeMap(() => throwError(error)));
|
||||
} else if (error.status === 401) {
|
||||
console.log('401', error);
|
||||
return this._modal
|
||||
.open({
|
||||
content: UiMessageModalComponent,
|
||||
@@ -33,9 +34,9 @@ export class HttpErrorInterceptor implements HttpInterceptor {
|
||||
})
|
||||
.afterClosed$.pipe(
|
||||
tap(() => {
|
||||
this._auth.logout();
|
||||
this._auth.login();
|
||||
}),
|
||||
mergeMap(() => throwError(error))
|
||||
mergeMap(() => NEVER)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,9 +30,16 @@ export class NativeContainerService {
|
||||
this.messages$.subscribe((message) => {
|
||||
if (message.status === 'INIT') {
|
||||
this._isNative = true;
|
||||
this._postMessage({ status: 'INIT', data: 'Is a WebView' });
|
||||
}
|
||||
});
|
||||
|
||||
// Functions to be called from native app
|
||||
if (this.window['scanResults'] === undefined) {
|
||||
this.window['scanResults'] = (result) => this._postMessage(result);
|
||||
}
|
||||
if (this.window['isRunningNative'] === undefined) {
|
||||
this.window['isRunningNative'] = (_) => this._postMessage({ status: 'INIT', data: 'Is a WebView' });
|
||||
}
|
||||
}
|
||||
|
||||
openScanner(scanRequestType: ScanRequestType) {
|
||||
|
||||
@@ -11,8 +11,6 @@ import { UiModalRef } from './defs';
|
||||
`,
|
||||
styleUrls: ['./message-modal.component.scss'],
|
||||
})
|
||||
export class UiMessageModalComponent implements OnInit {
|
||||
export class UiMessageModalComponent {
|
||||
constructor(public modalRef: UiModalRef) {}
|
||||
|
||||
ngOnInit() {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user