0

I'm starting my first project with Firebase. I just try to make a simple authentification for a website, but when I try to login myself, I have this error :

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

I went to firebase.google.com/docs/auth/ , but I didn't find a solution (maybe I miss it).
I made a user from the Firebase back-office.
Here is my controller :

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;
    });
}]);

And my 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> 

Thanks by advance

4
  • If you're just starting with Firebase, find a more up-to-date tutorial. Since you're using AngularFire, I'd start with the official documentation: github.com/firebase/angularfire#documentation Commented Oct 12, 2016 at 7:14
  • When I follow the doc instructions for authentication, I get this error : ReferenceError: email is not defined I updated my post with the currently code Commented Oct 12, 2016 at 10:49
  • Sounds like you're referencing email on your model but your ng-model is assigned to "mail". Commented Oct 12, 2016 at 15:17
  • Thx all for your answers, I finally use another thing to get a back end. Commented Oct 18, 2016 at 12:32

1 Answer 1

1

Your code looks right based on the old Firebase API. However, I think simpleLogin is going away, or possibly "gone", in your case. https://github.com/firebase/firebase-simple-login

You may need to update your login method to follow the new API. It looks like the old simple login wrapper is now part of the Firebase API: https://firebase.google.com/docs/auth/web/manage-users

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks I'm going to see that

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.