1
2export class AppComponent implements OnInit{
3 ngOnInit() {
4 window.addEventListener('storage', (event) => {
5 if (event.storageArea == localStorage) {
6 let token = this.authService.getUserToken();
7 if (token == undefined) {
8 this.authService.logout();
9 }
10 }
11 });
12 }
13}
14