Login refactor

This commit is contained in:
Michał Zieliński
2023-11-07 14:29:58 +01:00
parent 05f67ff9f3
commit db09a8c90f
6 changed files with 19 additions and 25 deletions

View File

@@ -20,7 +20,7 @@ export class AuthInterceptor implements HttpInterceptor {
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
if (!request.url.includes('/auth/apiToken')) {
if (this.auth$.expirationTime.isBefore(moment.utc())) {
if (this.auth$.apiTokenExpirationTime.isBefore(moment.utc())) {
return this.auth$.getAPITokenObservable().pipe(
mergeMap(() => {
return next.handle(request.clone({