From ecdf585216db9c2870e92998f45d705fd2406509 Mon Sep 17 00:00:00 2001 From: Julius Gruber Date: Thu, 6 Jun 2019 10:01:23 +0200 Subject: [PATCH] null check for auth interceptor --- src/app/core/auth/auth.interceptor.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/core/auth/auth.interceptor.ts b/src/app/core/auth/auth.interceptor.ts index 8aa6f084ea..d9697d3f20 100644 --- a/src/app/core/auth/auth.interceptor.ts +++ b/src/app/core/auth/auth.interceptor.ts @@ -162,8 +162,10 @@ export class AuthInterceptor implements HttpInterceptor { // clean eventually refresh Requests list this.refreshTokenRequestUrls = []; // console.log('error: ', error); - const location = this.getLocationfromHeader(error.headers); - + let location = ''; + if (error.headers.get('www-authenticate') != null) { + location = this.getLocationfromHeader(error.headers); + } // Create a new HttpResponse and return it, so it can be handle properly by AuthService. const authResponse = new HttpResponse({ body: this.makeAuthStatusObject(false, null, error.error, location),