From 2b1d4cd12a6c16e10ddd06d6e269bfd31a21b45c Mon Sep 17 00:00:00 2001 From: lotte Date: Fri, 14 Sep 2018 11:42:55 +0200 Subject: [PATCH] Fixed logout issue --- src/app/core/auth/auth.interceptor.ts | 2 +- src/app/core/auth/auth.service.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/core/auth/auth.interceptor.ts b/src/app/core/auth/auth.interceptor.ts index 651e2fd096..f38abb90bc 100644 --- a/src/app/core/auth/auth.interceptor.ts +++ b/src/app/core/auth/auth.interceptor.ts @@ -35,7 +35,7 @@ export class AuthInterceptor implements HttpInterceptor { } private isSuccess(response: HttpResponseBase): boolean { - return response.status === 200; + return (response.status === 200 || response.status === 204); } private isAuthRequest(http: HttpRequest | HttpResponseBase): boolean { diff --git a/src/app/core/auth/auth.service.ts b/src/app/core/auth/auth.service.ts index ea73ff9e1b..f8fc863ee9 100644 --- a/src/app/core/auth/auth.service.ts +++ b/src/app/core/auth/auth.service.ts @@ -140,7 +140,7 @@ export class AuthService { const person$ = this.rdbService.buildSingle(status.eperson.toString()); return person$.pipe(map((eperson) => eperson.payload)); } else { - throw(new Error('Not authenticated')); + Observable.throw(new Error('Not authenticated')); } })) }