Hi,
When i login from my woocommerce mobile app, successfully return the jwt but when validate, it show this error,
{“success”:false,“data”:{“message”:“User not found.”,“errorCode”:24}}
What should i do, here is my code
login()
{
const headers = new HttpHeaders({
'Content-Type': 'application/x-www-form-urlencoded'
});
const userData = `username=${this.username}&password=${this.password}`;
return new Promise((resolve, reject) => {
this.http
.post(`https://myurl.com/?rest_route=/simple-jwt-login/v1/auth&`, userData, { headers })
.subscribe(
res => {
console.log(res);
const auth = `JWT=${res['data']["jwt"]}&AUTH_KEY=myauth`;
return new Promise(resolve => {
this.http
.get(
`https://myurl.com/?rest_route=/simple-jwt-login/v1/auth/validate&JWT=${res['data']["jwt"]}`
)
.subscribe(res => {
console.log(res);
});
});
resolve(res);
},
err => {
alert(JSON.stringify(err));
resolve(err);
}
);
});
}