如何使用$ firebaseAuth()立即检测用户关闭Popup的时间。$ signInWithPopup?

时间:2016-06-27 20:36:48

标签: angularjs firebase angularfire firebase-authentication

我正在使用带有angularFire服务$ firebaseAuth的Firebase身份验证和$ signInWithPopup方法实现Google身份验证登录。

如果已经解决或拒绝了该方法,该方法将返回一个承诺。

我想改进的是用户在没有登录的情况下关闭弹出窗口 在这种情况下,承诺返回的代码错误是:auth/popup-closed-by-user 问题是可能需要30秒才能发生

app.controller("SampleCtrl", function($firebaseAuth) {

  $firebaseAuth().$signInWithPopup("google").then(function(result) {
    console.log("Signed in as:", result.user.uid);
  }).catch(function(error) {
    console.error("Authentication failed:", error);
  });

});

弹出窗口关闭时有没有办法立即捕捉?

编辑:我正在使用angularFire 2.0.1Firebase 3.0.3

0 个答案:

没有答案
相关问题