0
我有以下代碼;它成功創建用戶並返回一個承諾。根據該文件,則返回完成後,一個非空的用戶,但是,正如我嘗試打印出來的電子郵件或發送一封確認郵件,我得到「未定義」和「sendVerificationEmail是不是一個函數」使用電子郵件和密碼創建用戶返回非空值用戶,具有未定義值
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();
}
}
有什麼想法嗎?
http://stackoverflow.com/questions/37431128/firebase-confirmation-email-not-being-sent 這個線程可以幫助我認爲在使用sendemailverification api調用之前需要訪問api。 – rob