Router redirect to login instead of window reload
This commit is contained in:
parent
49e2532434
commit
eee8f8e949
1 changed files with 9 additions and 10 deletions
|
@ -34,15 +34,14 @@ export class FullLayoutComponent implements OnInit {
|
|||
}
|
||||
|
||||
userLogout() {
|
||||
console.log('logout clicked');
|
||||
this.api
|
||||
console.log('logout clicked');
|
||||
this.api
|
||||
.logout()
|
||||
.subscribe(
|
||||
result => {
|
||||
console.log('Logged out!');
|
||||
// TODO Reload? srsly?
|
||||
window.location.reload();
|
||||
}
|
||||
result => {
|
||||
console.log('Logged out!');
|
||||
this.router.navigate(['/login']);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue