0

I have a function to create users in a FireBase web application called registerWithEmailAndPassword. Here is the code:

const registerWithEmailAndPassword = async (name, email, password) => {
  try {
    const res = await auth.createUserWithEmailAndPassword(email, password);
    const user = res.user;
    ... do some useful things with the user ...
  } catch (err) {
    console.error(err);
    alert(err.message);
  }
};

The function above does pretty much what I need, but one big drawback due to the way auth.createUserWithEmailAndPassword works is that I get automatically signed in with the newly created user. This is what I do not need and do not want.

How can I properly avoid this signing in "side effect" ?

Michel
  • 10,303
  • 17
  • 82
  • 179
  • I created a solution based on createOtherUser in https://stackoverflow.com/questions/37517208/firebase-kicks-out-current-user. – Michel Jan 28 '23 at 03:54

0 Answers0