You're not waiting until the sign-up is complete. To do that you can use the then
part of the promise returned by createUserWithEmailAndPassword
.
So:
let promise = auth.createUserWithEmailAndPassword(email.value, password.value);
promise.then(
userCredential => userCredential.user.sendEmailVerification()
}).catch(
e => alert(e.message)
);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…