Created
December 15, 2017 08:08
-
-
Save dmcgrath/1042cbe0981cf4687ba9b0451163d442 to your computer and use it in GitHub Desktop.
Adding Auth
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
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