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),