"app.js“(保存所有的Firebase身份验证和初始化)和"sign-up.html”(一个简单的表单)
但是,我没有收到任何错误,也没有任何东西被发送到控制台,告诉我尽管使用了以下命令,但我已经登录了:
const promise = auth.signInWithEmailAndPassword(email, pass);
promise.catch(e => console.log(e.message));这是app.js:https://www.dropbox.com/s/4ph5e1ejr6ue1d7/app.js?dl=0和https://www.dropbox.com/s/wnvn17ggxn0uckh/sign-up.html?dl=0
发布于 2017-12-10 05:56:10
对从signInWithEmailAndPassword()返回的promise使用then()方法,以了解注册何时成功。由于API会告诉您发生了什么,因此不需要期望SDK在控制台上打印一些内容。你可以自己记录一些东西。
auth.signInWithEmailAndPassword(email, pass).then(user => {
// authenticated user is available here
}).catch(error => {
// something failed
})https://stackoverflow.com/questions/47733306
复制相似问题