在 Firebase 中进行身份验证的预期时间范围是什么?

What is the expected timeframe for authentication in firebase?

我正在使用内置的 Firebase 密码身份验证,我想知道通过 authWithPassword() 登录的 "reasonable" 超时是多少。我最初以为这将是亚秒级的,但现在看来波动很大,即使在 3 秒时我也会遇到很多超时。

note: I suspect this might not be the highest priority because for typical client app the logging in process is a one-time affair but for micro-services the headroom of 3 seconds is pretty substantial (most operations overall run time is 1-2 seconds). Happy to be wrong.

这对应用程序来说是相当主观的,但 Firebase 登录应该快于 3 秒。如果您一直看到时间过长和连接错误,那么您应该联系支持@firebase.com.

您还可以让 Firebase 在回调中为您处理超时 and/or 错误:

var ref = new Firebase("https://<YOUR-FIREBASE-APP>.firebaseio.com");
ref.authWithPassword({
  email    : "bobtony@firebase.com",
  password : "correcthorsebatterystaple"
}, function(error, authData) {
  if (error) {
    // this is your login issue
    console.error("Login Failed!", error);
  } else {
    console.log("Authenticated successfully with payload:", authData);
  }
});