Skip to content

Instantly share code, notes, and snippets.

@dmcgrath
Created December 15, 2017 08:08
Show Gist options
  • Save dmcgrath/1042cbe0981cf4687ba9b0451163d442 to your computer and use it in GitHub Desktop.
Save dmcgrath/1042cbe0981cf4687ba9b0451163d442 to your computer and use it in GitHub Desktop.
Adding Auth
var user = null;
var provider = new firebase.auth.GoogleAuthProvider();
firebase.auth().useDeviceLanguage();
firebase.auth().signInWithPopup(provider).then(function(result) {
user = result.user;
// All the Firestore code with 'enablePersistence()' goes here
}).catch(function(error) {
console.error(error.message);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment