firebase使用电子邮件和密码登录不使用等待功能vuejs

firebase使用电子邮件和密码登录不使用等待功能vuejs,firebase,vue.js,Firebase,Vue.js,当我在不使用await函数的情况下使用登录时,即使使用了错误的凭据,它也会登录;如果使用await函数,则不会发生任何事情,也不会显示任何错误 在使用wait功能时,即使凭据错误,也不会显示错误,在正确的凭据上,也不会显示console.log值。我做错了什么?为什么它不检查数据库的电子邮件和密码 你不应该在这里使用try-catch,让它像这样简单。此外,您不应发布有关firebase的信息。它是敏感的信息 async signIn() { try { le

当我在不使用
await
函数的情况下使用登录时,即使使用了错误的凭据,它也会登录;如果使用await函数,则不会发生任何事情,也不会显示任何错误


在使用
wait
功能时,即使凭据错误,也不会显示错误,在正确的凭据上,也不会显示
console.log
值。我做错了什么?为什么它不检查数据库的电子邮件和密码

你不应该在这里使用try-catch,让它像这样简单。此外,您不应发布有关firebase的信息。它是敏感的信息

 async signIn() {
   try {   
           let userCredential= await firebase.auth().signInWithEmailAndPassword(this.email, this.password)
           console.log("user value is",userCredential)
           this.$router.replace({name:'Sidebar'})      
      } catch (err) {
        console.log("Invalid user", err);
      }
    },
  },
};

我发现了错误。表单在提交时未提交正确的值。必须在表单外渲染值,并在没有表单的情况下正常传递值。

我也尝试了这种简单的方法,但仍然不起作用,谢谢,我删除了firebase代码。它也没有显示错误,所以我真的不明白问题出在哪里。
firebase.auth().signInWithEmailAndPassword(this.email, this.password)
   .then(function(firebaseUser) {
       // Success 
       console.log("user value is", firebaseUser)
       this.$router.replace({name:'Sidebar'})
   })
  .catch(function(error) {
       // Error Handling
       console.log("Invalid user", error);
  });