With my Angular 6 client I access the http://localhost:8082/login
to send username
and password
and return a token.
This is the error
Notice that, under error:
there is the token that I want.
This is how it looks on Postman
And this is the function I use on Angular to get the token with the given username and password
validateUser(user:User){
var reqHeader = new HttpHeaders({ 'Content-Type': 'application/json','No-Auth':'True' });
return this.httpClient.post<User>(this.apiURL + '/login',user,{headers:reqHeader});
}
I want just to return the token, like in Postman. I tried toPromise()
but I've got even more errors.