mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2025-09-06 06:57:21 +00:00
revamped sign-in, now that we have working checks
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<body>
|
||||
<div id="mySidenav" class="sidenav">
|
||||
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
|
||||
<a href="../">Profile</a>
|
||||
<a href="../profile">Profile</a>
|
||||
<a href="#">Team</a>
|
||||
<a href="../scout">Scout Matches</a>
|
||||
<a href="../stats">Torunament Stats</a>
|
||||
@@ -24,6 +24,7 @@
|
||||
<img id="sideload" src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/b2/Hamburger_icon.svg/1200px-Hamburger_icon.svg.png">
|
||||
</span>
|
||||
<h1 id="mainhead">TitanScout- Scout Matches</h1>
|
||||
<p id="status">Loading...</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -12,6 +12,31 @@ function closeNav() {
|
||||
document.body.style.backgroundColor = "white";
|
||||
}
|
||||
|
||||
window.onload=function(){
|
||||
window.onload = function() {
|
||||
document.getElementById('sideload').style.display = 'block';
|
||||
var config = {
|
||||
apiKey: "(insert the TitanScout Api Key Here)",
|
||||
authDomain: "titanscoutandroid.firebaseapp.com",
|
||||
databaseURL: "https://titanscoutandroid.firebaseio.com",
|
||||
projectId: "titanscoutandroid",
|
||||
storageBucket: "titanscoutandroid.appspot.com",
|
||||
messagingSenderId: "1097635313476"
|
||||
};
|
||||
//eventually find a less-jank way to do this tho
|
||||
firebase.initializeApp(config);
|
||||
firebase.auth().onAuthStateChanged(function(user) {
|
||||
if (user != null) {
|
||||
if (user.displayName != null) {
|
||||
document.getElementById('status').innerHTML = "You are signed in as: " + user.displayName;
|
||||
} else if (user.email != null) {
|
||||
document.getElementById('status').innerHTML = "You are signed in as: " + user.email;
|
||||
} else if (user.phoneNumber != null) {
|
||||
document.getElementById('status').innerHTML = "You are signed in as: " + user.phoneNumber;
|
||||
} else {
|
||||
document.getElementById('status').innerHTML = "You are signed in.";
|
||||
}
|
||||
} else {
|
||||
window.location.replace('../');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user