Answers for "angular logout user from all tabs"

0

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();
            }
         }
      });
  }
}
Posted by: Guest on March-08-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language