0

我開始使用Firebase開始我的第一個項目。我只是試圖使一個網站一個簡單的認證,但是當我嘗試登錄我自己,我有這樣的錯誤:
Firebase身份驗證失敗

Error: FirebaseSimpleLogin: Projects created at console.firebase.google.com must use the new Firebase Authentication SDKs available from firebase.google.com/docs/auth/

我去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> 

由於通過提前

+0

如果您剛開始使用Firebase,請查找更新的教程。由於您使用的是AngularFire,因此我會從官方文檔開始:https://github.com/firebase/angularfire#documentation –

+0

當我按照文檔說明進行身份驗證時,出現此錯誤: ReferenceError:電子郵件不是定義爲 我使用當前代碼更新了我的帖子 –

+0

聽起來像您在模型上引用電子郵件,但您的ng模型被分配給「郵件」。 –

回答