diff --git a/website/public/stats/index.html b/website/public/stats/index.html index 68e655c3..c15bbf15 100644 --- a/website/public/stats/index.html +++ b/website/public/stats/index.html @@ -24,6 +24,7 @@

TitanScout- Torunament Statistics

+

You are not signed in.

diff --git a/website/public/stats/scripts.js b/website/public/stats/scripts.js index f4499004..e3695290 100644 --- a/website/public/stats/scripts.js +++ b/website/public/stats/scripts.js @@ -14,4 +14,19 @@ function closeNav() { window.onload=function(){ document.getElementById('sideload').style.display = 'block'; + user= firebase.auth().currentUser + 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('../'); + } + }