From 92129ef2d78bc88b1c827c303f51bf7832aca109 Mon Sep 17 00:00:00 2001 From: Richard Park Date: Tue, 19 Nov 2019 19:03:58 +0900 Subject: [PATCH] logout notification is modified --- .../src/app/services/notification.service.ts | 2 +- .../src/app/store/account/authentication/effects.ts | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/services/notification.service.ts b/projects/ucap-webmessenger-app/src/app/services/notification.service.ts index d89323af..b53ea095 100644 --- a/projects/ucap-webmessenger-app/src/app/services/notification.service.ts +++ b/projects/ucap-webmessenger-app/src/app/services/notification.service.ts @@ -127,7 +127,7 @@ export class AppNotificationService { default: break; } - this.store.dispatch(AuthenticationStore.logout()); + this.store.dispatch(AuthenticationStore.loginRedirect()); }) ) .subscribe(); diff --git a/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts b/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts index 90100265..33ef6d5c 100644 --- a/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts @@ -125,10 +125,9 @@ export class Effects { ofType(loginRedirect), tap(authed => { this.ngZone.run(() => { - this.router.navigate(['/account/login']).then(() => { - this.store.dispatch(logoutInitialize()); - location.reload(); - }); + this.appAuthenticationService.logout(); + this.store.dispatch(logoutInitialize()); + location.href = this.router.parseUrl('/account/login').toString(); }); }) ), @@ -142,7 +141,6 @@ export class Effects { switchMap(action => { return this.authenticationProtocolService.logout({}).pipe( map(res => { - this.appAuthenticationService.logout(); this.store.dispatch(loginRedirect()); }), catchError(error => of(error))