Working off the auth0 lock react auth redux example here: https://github.com/auth0-blog/redux-auth/tree/auth0-lock
And using it for react native, I'm trying to call an auth0 login screen as part of my action dispatch in a redux react native app and I'm getting the error "Cannot have a non-function arg after a function arg" What does that error mean and why does it happen when I'm trying to call an auth0 lock function from within an action dispatch?
// actions.js
function showLogin() {
return {
type: LOGIN_REQUEST,
};
}
function loginSuccess(profile, token) {
return {
type: LOGIN_SUCCESS,
profile,
token,
};
}
function loginError(err) {
return {
type: LOGIN_FAILURE,
err,
};
}
export function login() {
return (dispatch) => {
dispatch(showLogin());
// it seems to error on the next line here calling the auth0 login method
lock.show((err, profile, token) => {
if (err) {
// handle error
return dispatch(loginError(err));
}
return dispatch(loginSuccess(profile, token));
});
};
}