I've encountered a puzzling issue with my code. It seems that the authenticateUser
function returns an array structured like this:
{
success: false,
msg: "invalid password"
}
However, when I attempt to verify if success == false
, I receive an error stating that there is no such property on type Objects.
this.authService.authenticateUser(user).subscribe(data=>{
if(data.success){//here need to check response for success
console.log(data)
this.authService.storeUserData(data);
this.router.navigate(['/user']);
}else{
this.router.navigate(['/login']);
}
Despite reviewing examples from various tutorials, I have yet to find a solution to this problem.