Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createUser() error but still refreshes auth #1072

Open
MorenoMdz opened this issue Mar 15, 2021 · 1 comment
Open

createUser() error but still refreshes auth #1072

MorenoMdz opened this issue Mar 15, 2021 · 1 comment

Comments

@MorenoMdz
Copy link

Do you want to request a feature or report a bug?

Bug.

What is the current behavior?

When you try to create a new user as in auth and it fails (duplicated email etc) the store state updates and no error is returned.

What is the expected behavior?

Screen to not refresh, as it is clearing the signup form.

Which versions of dependencies, and which browser and OS are affected by this issue? Did this work in previous versions or setups?

   "react-redux": "^7.2.1",
    "react-redux-firebase": "^3.10.0",
    "redux-firestore": "^0.13.0",

One of the ways I tried:

...
createUser = async (email, password, name, phone, address) => {
  await getFirebase().createUser(
    {
      email: email,
      password
    },
    {
      name,
      email: email,
      phone: phone,
      address: address,
      createdAt: new Date()
    }
  );
  this.setState({ loading: false });
};
...

At the moment I am trying to set up it in a functional component, I might need to save the user input in a ref somehow to reuse it if the createUser() attempt still refreshes the screen/state.

Any idea why is it refreshing even on error? I tried catching the error in a try-catch it still reloads.

Thanks!

@jonathan-chin
Copy link

Hi, I'm experiencing this same issue. when it fails due to duplicate email (I haven't tested other kinds of failure), it updates the state, producing an infinite loop (for me). I've also tried using a try/catch block but to no avail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants