I want to avoid automatically login after using createUserWithEmailAndPassword with React and Firebase. is that possible? Here is my code. Thanks a lot.
const SignUp = () => {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [displayName, setDisplayName] = useState("");
const [error, setError] = useState(null);
const createUserWithEmailAndPasswordHandler = async (event, email, password) => {
event.preventDefault();
try{
const {user} = await auth.createUserWithEmailAndPassword(email, password);
generateUserDocument(user, {displayName});
const test = user.emailVerified;
console.log("Verified: ",test,);
}
catch(error){
setError('Error: ... '+error);
};
setEmail("");
setPassword("");
setDisplayName("");
user.sendEmailVerification({url: process.env.REACT_APP_CONFIRMATION_EMAIL_REDIRECT="https://...my url.........."});
console.log('Email is not verified ');
alert("email confirmation sent");
};