I am encountering challenges with a specific portion of my code. I am in the process of sending user information to the server, receiving a token from the user, and then aiming to redirect the user to a URL. However, despite the code entering the if statement (which I assumed indicated success), it proceeds to the else statement for unknown reasons. Additionally, any explanation on the use of .setToken would be greatly appreciated...
apiClient.LoginInfo(data).then(function (response) {
if (response.result === 'success') {
$auth.setToken(response);
window.location.href = ('some URL'.a_href);
console.log('+susses');
}
else {
console.log('else', response);
}
}, function (error) {
console.log('error', error);
});
};
};