Commit 75de749a authored by Tom Käsler's avatar Tom Käsler
Browse files

Delete local session data when user deletes account

parent b88f8486
......@@ -132,12 +132,13 @@ export class HeaderComponent implements OnInit {
}
deleteAccount(id: string) {
this.userService.delete(id).subscribe();
this.authenticationService.logout();
this.translationService.get('header.account-deleted').subscribe(msg => {
this.notificationService.show(msg);
this.userService.delete(id).subscribe(_ => {
this.authenticationService.deleteLocal();
this.translationService.get('header.account-deleted').subscribe(msg => {
this.notificationService.show(msg);
});
this.navToHome();
});
this.navToHome();
}
openDeleteUserDialog() {
......
......@@ -190,6 +190,12 @@ export class AuthenticationService extends BaseHttpService {
this.user.next(undefined);
}
deleteLocal() {
this.dataStoreService.remove(this.STORAGE_KEY);
localStorage.clear();
this.user.next(undefined);
}
getUser(): User {
return this.user.getValue();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment