Last active
November 16, 2017 06:32
-
-
Save erezrokah/be11192a4faf01ded0f7f17a549cb07e to your computer and use it in GitHub Desktop.
Firebase google sign-in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getCredential(token) { | |
return { token, secret: 'SomeRandomNumber', provider: 'google' }; | |
} | |
function signInWithCredential(token) { | |
return firebase.auth().signInWithCredential(getCredential(token)) | |
.then(user => { | |
console.log('signed in'); | |
}) | |
} | |
function googleSignin() { | |
GoogleSignin.signIn().then(user => { | |
signInWithCredential(user.idToken); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment