From 0af31aa8b679cee33e763a70ebd7dc017dd7bf6d Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Sun, 21 Mar 2021 14:44:55 +0000 Subject: [PATCH] Add login/logout page reloads --- src/app/auth/login.component.ts | 3 ++- src/app/layouts/full-layout.component.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/auth/login.component.ts b/src/app/auth/login.component.ts index 07a0766..130ce7d 100644 --- a/src/app/auth/login.component.ts +++ b/src/app/auth/login.component.ts @@ -45,7 +45,8 @@ export class LoginComponent implements OnInit { .subscribe( result => { this.loginStatus = 'success'; - this.router.navigate([this.returnUrl]); + this.router.navigate([this.returnUrl]) + .then(() => { window.location.reload() }); }, error => { console.log( error._body ); diff --git a/src/app/layouts/full-layout.component.ts b/src/app/layouts/full-layout.component.ts index ff74ceb..2ccf68d 100644 --- a/src/app/layouts/full-layout.component.ts +++ b/src/app/layouts/full-layout.component.ts @@ -34,13 +34,14 @@ export class FullLayoutComponent implements OnInit { } userLogout() { - console.log('logout clicked'); + console.debug('logout clicked'); this.api .logout() .subscribe( result => { localStorage.clear(); - this.router.navigate(['/login']); + this.router.navigate(['/login']) + .then(() => { window.location.reload() }); } ); }