Skip to content

Instantly share code, notes, and snippets.

@letswritetw
Created February 1, 2021 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save letswritetw/457b960d227caf58c70e69b3a0b0f888 to your computer and use it in GitHub Desktop.
Save letswritetw/457b960d227caf58c70e69b3a0b0f888 to your computer and use it in GitHub Desktop.
firebase-auth-google-fb
const provider = new firebase.auth.FacebookAuthProvider();
firebase
.auth()
.signInWithPopup(provider)
.then((result) => {
var credential = result.credential;
var user = result.user;
var accessToken = credential.accessToken;
})
.catch((error) => {
var errorCode = error.code;
var errorMessage = error.message;
var email = error.email;
var credential = error.credential;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment