Commented out some things on logout

main
Luna 2021-07-25 11:55:47 -07:00
parent 14d96e9ff2
commit e76732077d
1 changed files with 12 additions and 12 deletions

View File

@ -1,6 +1,6 @@
// //VARIBLES
myStorage = window.localStorage;
allCookies = document.cookie;
// // //VARIBLES
// myStorage = window.localStorage;
// allCookies = document.cookie;
//LOGOUT FETCH FUNCTION
@ -20,13 +20,13 @@ async function logout() {
loggedIn()
}
// IF THERE IS A TOKEN BUT NO USERNAME LOGOUT
if (allCookies !== '' && myStorage.length === 0) {
logout()
}
// // IF THERE IS A TOKEN BUT NO USERNAME LOGOUT
// if (allCookies !== '' && myStorage.length === 0) {
// logout()
// }
// IF THERE IS NO COOKIE BUT A USERNAME GET RID OF USERNAME LOCALLY.
if (allCookies === '' && myStorage.length !== 0) {
localStorage.removeItem('username')
document.querySelector("#loggeduser").innerHTML = 'You are not logged in'
}
// // IF THERE IS NO COOKIE BUT A USERNAME GET RID OF USERNAME LOCALLY.
// if (allCookies === '' && myStorage.length !== 0) {
// localStorage.removeItem('username')
// document.querySelector("#loggeduser").innerHTML = 'You are not logged in'
// }