firebase + facebook front end - Front end query

后端 未结 1 1945
难免孤独
难免孤独 2021-01-26 09:52

I am trying to do a facebook login for my firebase app. This is the first time I am using a FB login. I went through the article and small tutorials. But I am stuck at the front

相关标签:
1条回答
  • 2021-01-26 10:30

    Check out http://firebase.github.io/firebase-simple-login/ for an example of Firebase Simple Login in action that you can copy / fork and drop into your application.

    Here's a simple example of an application which allows you to login to Facebook upon link click:

    Login

      <script type="text/javascript" src="https://cdn.firebase.com/v0/firebase.js"></script>
      <script type="text/javascript" src="https://cdn.firebase.com/v0/firebase-auth-client.js"></script>
      <script type="text/javascript">
        var firebaseRef = new Firebase("[myFirebase]");
        var authClient = new FirebaseAuthClient(firebaseRef, function(error, user) {
          if (error) {
            // an error occurred while attempting login
            console.log('an error occurred:');
            console.log(error);
          } else if (user) {
            // user authenticated with Firebase
            console.log('logged in:');
            console.log(user);
          } else {
            // user is logged out
            console.log('logged out');
          }
        });
      </script>
    </body>
    </html>
    
    0 讨论(0)
提交回复
热议问题