Commented out some things on logout
parent
14d96e9ff2
commit
e76732077d
24
logout.js
24
logout.js
|
@ -1,6 +1,6 @@
|
||||||
// //VARIBLES
|
// // //VARIBLES
|
||||||
myStorage = window.localStorage;
|
// myStorage = window.localStorage;
|
||||||
allCookies = document.cookie;
|
// allCookies = document.cookie;
|
||||||
|
|
||||||
//LOGOUT FETCH FUNCTION
|
//LOGOUT FETCH FUNCTION
|
||||||
|
|
||||||
|
@ -20,13 +20,13 @@ async function logout() {
|
||||||
loggedIn()
|
loggedIn()
|
||||||
}
|
}
|
||||||
|
|
||||||
// IF THERE IS A TOKEN BUT NO USERNAME LOGOUT
|
// // IF THERE IS A TOKEN BUT NO USERNAME LOGOUT
|
||||||
if (allCookies !== '' && myStorage.length === 0) {
|
// if (allCookies !== '' && myStorage.length === 0) {
|
||||||
logout()
|
// logout()
|
||||||
}
|
// }
|
||||||
|
|
||||||
// IF THERE IS NO COOKIE BUT A USERNAME GET RID OF USERNAME LOCALLY.
|
// // IF THERE IS NO COOKIE BUT A USERNAME GET RID OF USERNAME LOCALLY.
|
||||||
if (allCookies === '' && myStorage.length !== 0) {
|
// if (allCookies === '' && myStorage.length !== 0) {
|
||||||
localStorage.removeItem('username')
|
// localStorage.removeItem('username')
|
||||||
document.querySelector("#loggeduser").innerHTML = 'You are not logged in'
|
// document.querySelector("#loggeduser").innerHTML = 'You are not logged in'
|
||||||
}
|
// }
|
Loading…
Reference in New Issue