angular logout from all tabs code example
Example: angular logout user from all tabs
export class AppComponent implements OnInit{
ngOnInit() {
window.addEventListener('storage', (event) => {
if (event.storageArea == localStorage) {
let token = this.authService.getUserToken();
if (token == undefined) {
this.authService.logout();
}
}
});
}
}