Skip to content

Instantly share code, notes, and snippets.

@kylejlin
Last active November 29, 2016 06:14
Show Gist options
  • Save kylejlin/a6499d5eb446dc5b92198274f0542058 to your computer and use it in GitHub Desktop.
Save kylejlin/a6499d5eb446dc5b92198274f0542058 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script>
function fbLoad(){
// Initialize Firebase
var config = {
apiKey: "AIzaSyD-jLTzShaImxMkJfJQJKfE8UJZzq5KSZ0",
authDomain: "test-65a9a.firebaseapp.com",
databaseURL: "https://test-65a9a.firebaseio.com",
storageBucket: "test-65a9a.appspot.com",
messagingSenderId: "549480828636"
};
firebase.initializeApp(config);
var provider = new firebase.provider.GoogleAuthProvider();
firebase.auth().signInWithPopup(provider).then(function(result) {
var token = result.credential.accessToken;
var user = result.user;
}).catch(function(error) {
var errorCode = error.code;
var errorMessage = error.message;
var email = error.email;
var credential = error.credential;
// God help me here...
});
console.log('Firebase loaded!');
}
</script>
<script src="https://www.gstatic.com/firebasejs/3.6.1/firebase.js" onload="fbLoad()">
</script>
</head>
<body>
<b>Hi</b>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment