Don't use cookie when logged in.
This commit is contained in:
parent
31f6737f92
commit
6bb6821d39
|
@ -10,20 +10,24 @@
|
||||||
window.scrollTo(0, document.body.scrollHeight);
|
window.scrollTo(0, document.body.scrollHeight);
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
if (window.location.search.includes("reset=true")) {
|
{% if not username %}
|
||||||
window.history.pushState({}, document.title, window.location.pathname);
|
if (window.location.search.includes("reset=true")) {
|
||||||
return;
|
window.history.pushState({}, document.title, window.location.pathname);
|
||||||
}
|
return;
|
||||||
decodeURIComponent(document.cookie).split(';').forEach(cookie => {
|
|
||||||
[id, value] = cookie.trim().split('=')
|
|
||||||
if (!id || !value) {
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
const e = document.getElementById(id)
|
const cookies = decodeURIComponent(document.cookie)
|
||||||
if (e) {
|
.split(';')
|
||||||
e.value = value
|
.map(cookie => cookie.trim().split('='))
|
||||||
}
|
cookies.forEach(([id, value]) => {
|
||||||
})
|
if (!id || !value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const e = document.getElementById(id)
|
||||||
|
if (e) {
|
||||||
|
e.value = value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
{% endif %}
|
||||||
}
|
}
|
||||||
|
|
||||||
const clearErrors = () => {
|
const clearErrors = () => {
|
||||||
|
|
Loading…
Reference in New Issue