Skip to content

Instantly share code, notes, and snippets.

@Ryan-Gordon
Created March 3, 2018 15:15
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 Ryan-Gordon/414695174718a689ad2aef7262a243ee to your computer and use it in GitHub Desktop.
Save Ryan-Gordon/414695174718a689ad2aef7262a243ee to your computer and use it in GitHub Desktop.
googleLogin(): Promise<any> {
return new Promise((resolve, reject) => {
this.googlePlus.login({
'webClientId': '5351366995-npuh9q89gaoiagoc4jssqck26gorj7hh.apps.googleusercontent.com',
'offline': true
}).then( res => {
const googleCredential = firebase.auth.GoogleAuthProvider
.credential(res.idToken);
firebase.auth().signInWithCredential(googleCredential)
.then( response => {
console.log("Firebase success: " + JSON.stringify(response));
resolve(response)
});
}, err => {
console.error("Error: ", err)
reject(err);
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment