繁体   English   中英

Firebase身份验证失败

[英]Firebase authentication failed

我正在用Firebase开始我的第一个项目。 我只是尝试对网站进行简单的身份验证,但是当我尝试登录自己时,出现此错误:

错误:FirebaseSimpleLogin:在console.firebase.google.com上创建的项目必须使用可从firebase.google.com/docs/auth/获得的新Firebase身份验证SDK。

我去了firebase.google.com/docs/auth/,但是找不到解决方案(也许我错过了)。
我是从Firebase后台创建一个用户的。
这是我的控制器:

angular.module('roomApp')
.controller('homeCtrl', function($scope, $firebaseObject) {
    // var firebaseObj = new Firebase("https://roomsaveur-4dfe8.firebaseio.com");
    console.log('tototo')

    firebase.initializeApp(config);

    const rootRef = firebase.database().ref().child('roomsaveur-4dfe8');
    const ref = rootRef.child('database');
    this.object = $firebaseObject(ref);

    firebase.auth().createUserWithEmailAndPassword(email, password).then(function(user) {
        var user = firebase.auth().currentUser;
        var email = $scope.user.email;
        var password = $scope.user.password;
        // logUser(user); // Optional
    }, function(error) {
        console.log(error)
        var errorCode = error.code;
        var errorMessage = error.message;
    });
}]);

而我的HTML:

<form class="form-signin" role="form">
    <input ng-model="mail" type="email" class="form-control" placeholder="Email address" required="" autofocus="">
    <input ng-model="password" type="password" class="form-control" placeholder="Password" required="">
    <button class="btn btn-lg btn-primary btn-block" type="submit" ng-click="signIn($event)">Sign in</button>
</form> 

预先感谢

根据旧的Firebase API,您的代码看起来正确。 但是,对于您而言,我认为simpleLogin将会消失,或者可能“消失”。 https://github.com/firebase/firebase-simple-login

您可能需要更新您的登录方法以遵循新的API。 看起来旧的简单登录包装现在已成为Firebase API的一部分: https ://firebase.google.com/docs/auth/web/manage-users

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM