I have the following code; it successfully creates the user and returns a promise. According to the documentation, it returns a non-null user upon completion, however, as i try to print out the email or send a verification email i get "undefined" and "sendVerificationEmail is not a function"
function register(){
var email = document.getElementById('email').value;
var password = document.getElementById('pass').value;
var promise = firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
// ...
});
if(promise != null){
alert(promise.email);
promise.sendEmailVerification();
}
}
any ideas?