null check for auth interceptor

This commit is contained in:
Julius Gruber
2019-06-06 10:01:23 +02:00
parent 41e238bad7
commit ecdf585216

View File

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