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" ?