IPad fIx test 2

This commit is contained in:
Lorenz Hilpert
2023-03-08 18:58:02 +01:00
parent ccbec5bcff
commit fba324c6cb
5 changed files with 19 additions and 15 deletions

View File

@@ -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();
});
}
}
}

View File

@@ -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)
);
}