summary refs log tree commit diff
path: root/assets/preload-plugins/loginRedirect.js
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-26 16:36:54 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-26 16:36:54 +1100
commit9cd27dad6fd8e054637e93492e7c0971067a461d (patch)
treef5476c4933de301e12c0ffc23a009bb56c31ebc1 /assets/preload-plugins/loginRedirect.js
parenthandle a specific case with rtl character (diff)
downloadserver-9cd27dad6fd8e054637e93492e7c0971067a461d.tar.xz
'localStorage is not defined'?
Diffstat (limited to '')
-rw-r--r--assets/preload-plugins/loginRedirect.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/assets/preload-plugins/loginRedirect.js b/assets/preload-plugins/loginRedirect.js

index cda4da44..0b5e443a 100644 --- a/assets/preload-plugins/loginRedirect.js +++ b/assets/preload-plugins/loginRedirect.js
@@ -1,7 +1,7 @@ if (window.location.hostname !== "127.0.0.1" && window.location.hostname !== "localhost") { const redirectIfOnLogin = () => { const path = window.location.pathname; - if (path == "/login" || path == "/register" || !localStorage.getItem("token")) { + if (path == "/login" || path == "/register" || !window.localStorage.getItem("token")) { window.location.pathname = "/login"; //window.location.reload(); }