Skip to content

Instantly share code, notes, and snippets.

@letswritetw
Last active 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/cfdbc74c91ae4581aeae42f0163730a9 to your computer and use it in GitHub Desktop.
Save letswritetw/cfdbc74c91ae4581aeae42f0163730a9 to your computer and use it in GitHub Desktop.
firebase-auth-google-fb
const provider = new firebase.auth.GoogleAuthProvider();
firebase.auth()
.signInWithPopup(provider)
.then((result) => {
var credential = result.credential;
var token = credential.accessToken;
var user = result.user;
}).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