Clear storage on logout
MODIFY
src/app/components/pas-header/pas-header.component.ts
src/app/components/pas-header/pas-header.component.ts
@@ -11,16 +11,14 @@ export class PasHeaderComponent {
public user: string = this.keycloak.getKeycloakInstance().profile.username;
- constructor(private keycloak: KeycloakService, private router: Router, private route: ActivatedRoute) {
+ constructor(private keycloak: KeycloakService) {
}
/**
* Logout a user and clear the session tokens
*/
public logout() {
- const firstChild = this.route;
- sessionStorage.setItem('apiman_keycloak_token', '');
- sessionStorage.setItem('apiman_keycloak_refresh_token', '');
+ sessionStorage.clear();
this.keycloak.getKeycloakInstance().logout({
redirectUri: location.href
});

GW-271: Clear storage on logout