ngOnInit(){
this.verifyService.verifyToken(this.token).subscribe(
data => {
this.res = data.json();
if(this.res.info){
console.log('Done')
}
else{
this.router.navigate(['/login']);
localStorage.removeItem('auth_token');
console.log('Error token. Please, log in');
}
}
)
}
ngOnInit(){
this.verifyService.verifyToken(this.token)
.subscribe(data => respondHandler(data))
}
ngOnInit(){
this.verifyService.verifyToken(this.token)
.subscribe(data => this.respondHandler(data), error => this.errorHandler(error))
}