Created
September 22, 2016 16:38
-
-
Save thangman22/144d1874e0133d737c264cfb7ac3b1e2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Thangman22 auth</title> | |
<script src="https://www.gstatic.com/firebasejs/3.4.0/firebase.js"></script> | |
<script> | |
// Initialize Firebase | |
var config = { | |
apiKey: "xxxxx", | |
authDomain: "thangman22-auth.firebaseapp.com", | |
databaseURL: "https://thangman22-auth.firebaseio.com", | |
storageBucket: "thangman22-auth.appspot.com", | |
messagingSenderId: "xxxxx" | |
}; | |
firebase.initializeApp(config); | |
var provider = new firebase.auth.GoogleAuthProvider(); | |
function onSignInButtonClick(){ | |
firebase.auth().signInWithPopup(provider).then(function(result) { | |
console.log(result); | |
//Do something when login complete | |
}).catch(function(error) { | |
//Do something when error | |
}); | |
} | |
</script> | |
</head> | |
<body> | |
<button onclick="onSignInButtonClick()">Login</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment