diff --git a/.gitignore b/.gitignore index 290e44d..e74dfca 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ streamchat.code-workspace index.html stream.css assets/ -todo.txt \ No newline at end of file +todo.txt +logout.js \ No newline at end of file diff --git a/chat.css b/chat.css index fc3829f..5ed8007 100644 --- a/chat.css +++ b/chat.css @@ -12,6 +12,10 @@ input { padding: 3%; } +label { + visibility: hidden; +} + #chatbox { background-color: white; padding: 1rem; diff --git a/chat.html b/chat.html index 4d2f232..62d56fc 100644 --- a/chat.html +++ b/chat.html @@ -21,7 +21,8 @@ -
diff --git a/chat.js b/chat.js index 0e43d9a..f216c0c 100644 --- a/chat.js +++ b/chat.js @@ -3,7 +3,6 @@ let date = '2021-07-22' let messageCount = 0; let username = localStorage.getItem('username'); const form = document.querySelector('form'); -document.querySelector("#loggeduser").innerHTML = `You are logged in as ${username}` // SEND A MESSAGE @@ -64,3 +63,13 @@ function printText(text) { div.appendChild(p) p.innerHTML = text } + + +//LOGGED IN STUFF +//TODO ADD CHECK TO SEE IF USERNAME AND TOKEN MATCHES +if (username === null) { + document.querySelector("#loggeduser").innerHTML = 'You are not logged in' + username = '' +} else { + document.querySelector("#loggeduser").innerHTML = `You are logged in as ${username}` +} \ No newline at end of file diff --git a/login.html b/login.html index 6915897..48ad76a 100644 --- a/login.html +++ b/login.html @@ -16,7 +16,7 @@