aboutsummaryrefslogtreecommitdiff
path: root/views/authenticate.js
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2025-02-08 17:12:22 +0200
committerSyndamia <kamen@syndamia.com>2025-02-08 17:12:22 +0200
commitc1a7d625fc0c86727a4e4a9dc6cfa1e19699d170 (patch)
tree02001659fef0e2b578a6c8644d579344accd5748 /views/authenticate.js
parent6a3ac35d35e92537438a47eb0441a077a5d791cf (diff)
downloadnowayforward_human-c1a7d625fc0c86727a4e4a9dc6cfa1e19699d170.tar
nowayforward_human-c1a7d625fc0c86727a4e4a9dc6cfa1e19699d170.tar.gz
nowayforward_human-c1a7d625fc0c86727a4e4a9dc6cfa1e19699d170.zip
feat(authenticate): Delete requests for expired cookies
Diffstat (limited to 'views/authenticate.js')
-rw-r--r--views/authenticate.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/views/authenticate.js b/views/authenticate.js
index 398794a..5b64ecd 100644
--- a/views/authenticate.js
+++ b/views/authenticate.js
@@ -28,7 +28,12 @@ function requestAuthentication() {
request.onreadystatechange = function() {
if (request.readyState < 4) return;
- authentication_response = (request.status == 200) ? request.responseText : "";
+ if (request.status == 200) {
+ authentication_response = request.responseText;
+ }
+ else if (request.status == 410) {
+ cookieStorage.removeItem('token');
+ }
}
request.open("POST", "/authenticate", true);
request.send(null);