Don't use cookie when logged in.

This commit is contained in:
Sage Vaillancourt 2022-09-29 13:02:09 -04:00
parent 31f6737f92
commit 6bb6821d39
1 changed files with 17 additions and 13 deletions

View File

@ -10,12 +10,15 @@
window.scrollTo(0, document.body.scrollHeight);
{% endif %}
{% if not username %}
if (window.location.search.includes("reset=true")) {
window.history.pushState({}, document.title, window.location.pathname);
return;
}
decodeURIComponent(document.cookie).split(';').forEach(cookie => {
[id, value] = cookie.trim().split('=')
const cookies = decodeURIComponent(document.cookie)
.split(';')
.map(cookie => cookie.trim().split('='))
cookies.forEach(([id, value]) => {
if (!id || !value) {
return
}
@ -24,6 +27,7 @@
e.value = value
}
})
{% endif %}
}
const clearErrors = () => {