react-native-firestack: [V3] ios login errors from loginWithEmailAndPassword coming back as undefined

Hi so I’m using the latest v3 branch like this:

export const loginWithEmail = ({ email, password }) =>
((dispatch: Dispatch) => {
  console.log(email, password);
  dispatch({ type: BEGIN_EMAIL_LOGIN });
  firestack.auth()
  .signInWithEmailAndPassword(email, password)
  .then((user) => {
    console.log('firebase sign in succesful: ', user)
    dispatch({
      type: FIREBASE_LOGIN_SUCCESFUL,
    });
  })
  .catch(err => console.log('error logging into firebase ', err));
});

which works if I provide the right email and password, but any error I get back is just coming back as an object with code of “” and message of undefined:

screen shot 2017-02-15 at 16 34 54

once I have some error messages to go off I’m finally going to get around to making that error code nromalising module Ive been promising forever, but I need an error code haha

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Reactions: 1
  • Comments: 23

Most upvoted comments

Awesome! I think @auser is responsible for committing pull requests on this branch. Looks good though!

@SamMathewIsACommonName I just updated my PR since I was also having the following issue when using signWithEmailAndPassword :

screen shot 2017-03-09 at 00 48 14

The commit follows the same changes I did for create a user with email / password :
https://github.com/fullstackreact/react-native-firestack/pull/304/files/3e7490883c8d9b4f0443a8f58f58a91dd097012e..948b882231c1d30cd8b502e2f3ba08b8602aff55

The error output is now like this :

Object {code: “17009”, message: “The password is invalid or the user does not have a password.”}

I shall update my PR with the casting change

Update: PR updated.

@SamMatthewsIsACommonName , I was having the same issue. I have created a pull request to resolve this precise issue : https://github.com/fullstackreact/react-native-firestack/pull/304 seems to be due to a variable name mismatch.