I developed a user login feature:
export const userLogin = (email, password) => (dispatch) => {
console.log(email, password);
dispatch({ type: actionTypes.AUTH_LOGIN_STARTED });
console.log("after dispatch");
Parse.User.logIn(email, password, {
success(user) {
console.log("in success");
dispatch({
type: actionTypes.AUTH_LOGIN_SUCCESS,
user: user.toJSON(),
});
window.location.replace('/');
},
error(user, error) {
console.log("in error")
console.log({ error });
// The login failed. Check error to see why.
dispatch({
type: actionTypes.AUTH_LOGIN_ERROR,
error,
});
},
});
};
However, it seems to get stuck after the Parse.User.logIn
function and does not trigger either the success or error callback. I've verified that the email and password are correct.
What could be causing this issue?