Search code examples
firebasefirebasesimplelogin

Firebase social media authentication just displaying a blank screen


I'm trying to hook up the social media authentication using the Firebase authentication providers https://www.firebase.com/docs/web/guide/user-auth.html#section-providers but all I'm getting is a blank screen from both Facebook & Twitter.

I've tested locally and even made the site live but nothing but a blank screen.

this is my Facebook auth code

authRef.authWithOAuthPopup('facebook', function(error, authData) { 
  console.log(authData);
}, {
  remember: 'sessionOnly',
  scope: 'email,public_profile'
});

And this is my Twitter snippet:

authRef.authWithOAuthPopup('twitter', function(error, authData) {
  if (authData) {
    // the access token will allow us to make Open Graph API calls
    console.log(authData);
  }

  console.log(error);
});

To note I'm using the latest version of Firebase v2.0.5 were the SimpleLogin is part of core and not a separate library.

    New Firebase instance:
var authRef = new Firebase(myfirebase);

Click event:

   $('social-auth').on('click',function(e) {
        e.preventDefault();
        var socialSite = this.getAttribute('data-social-site');

    If(socialSite === 'facebook') {
        // this where the Facebook OAuthPopUp is called.
        facebook();
    }
}

Solution

  • Ok I think there must of been a bug in v2.0.4 as I've upgraded to v2.0.5 and now the authentication from Facebook, Twitter and Google Plus are now working no problem.