I am using the keycloak-angular library with an Angular 6 project.
I am trying to convert the keycloakService.logout() promise to an observable:
keycloakLogout(): void {
defer(() => this.keycloakService.logout(config.frontUrl + '/home')).subscribe(() => {
localStorage.removeItem('authenticationToken');
this.accountService.authenticate(null)
});
}
My problem is that whenever I call this method, authenticationToken is not removed from localStorage.
Any idea?