火力地堡谷歌登录 [英] Firebase Google Login

查看:161
本文介绍了火力地堡谷歌登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

火力地堡去precated FirebaseSimpleLogin,所以我们一直在努力实施新authWithOAuthPopup,但我们总是收到控制台错误:类型错误:未定义的是不是一个函数。

Firebase deprecated FirebaseSimpleLogin, so we've been trying to implement the new authWithOAuthPopup, but we keep getting a console error: TypeError: undefined is not a function.

var app = angular.module("myApp", ["firebase"]);

app.controller("appCtrl", function($scope, $firebase) {

var ref = new Firebase("https://[forge].firebaseio.com/users");

// Login using Google
$scope.loginGoogle = function() {
    console.log("Got into google login");
    ref.authWithOAuthPopup("google", function(error, authData) { 
        console.log("yeah, we got in! " + user.uid);
    }, {
          remember: "sessionOnly",
          scope: "email"
    });
};


 $scope.logout = function() {
    ref.unauth();
  };


});

我在做什么错了?

What am I doing wrong?

推荐答案

委派的身份验证方法(即通过O​​Auth提供者,或发送电子邮件/密码验证等)加入到火力地堡的核心客户端库于2014年10月3日,并会从该日起需要一个客户端库或更高版本(> = 1.1.0 Web客户端)。

The delegated authentication methods (i.e. authenticating via OAuth providers, or email / password, etc.) were added to Firebase core client libraries on October 3rd 2014, and will require a client library from that date or later (>= 1.1.0 for the web client).

获取最新的Web客户端库,并查看更改日志,在的https:// WWW .firebase.com /文档/网页/ changelog.html

Grab the latest web client library, and view the changelog, at https://www.firebase.com/docs/web/changelog.html.

这篇关于火力地堡谷歌登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆