I have this header x-token added
I set my token saved in localStorage by using headers in Angular service:
validateToken(){
let headers = new HttpHeaders().set('x-token', localStorage.getItem('token') || '');
return this.authService.get("/api/auth/relogin",{headers})
}
I subscribe info in other component:
login(){
this.authService.validateToken().subscribe(token => console.log(token));
}
What i got is this error:
I've tried to do configs in the request, i've seen solutions like adding responseType:'text' and more like that, but when doing it, the subscribe info shows this in console: