From 3b5e3a30cd7f781c064d9cc5eaa0d36a2370844e Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Sun, 7 Aug 2022 11:04:56 -0400 Subject: [PATCH 1/2] Log users out when browser tab is closed. --- app/frontend/templates/base.html | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/frontend/templates/base.html b/app/frontend/templates/base.html index 4133dfac..46b6e622 100755 --- a/app/frontend/templates/base.html +++ b/app/frontend/templates/base.html @@ -15,7 +15,7 @@ + href="https://cdn.datatables.net/v/bs4/dt-1.10.22/fh-3.1.7/r-2.2.6/sc-2.0.3/sp-1.2.2/datatables.min.css" /> @@ -72,7 +72,7 @@ {% include notify.html %} @@ -163,7 +163,7 @@ + src="https://cdn.datatables.net/v/bs4/dt-1.10.22/fh-3.1.7/r-2.2.6/sc-2.0.3/sp-1.2.2/datatables.min.js"> @@ -191,7 +191,7 @@ $.extend($.fn.dataTable.defaults, { // {{ '\nlanguage:' }} {% raw translate('datatables', 'i18n', data['lang']) %} - }) + }) //used to get cookies from browser - this is part of tornados xsrf protection - it's for extra security function getCookie(name) { @@ -516,6 +516,9 @@ }); }); + $(window).unload(function () { + jQuery.get("/public/logout") + }); {% block js %} @@ -525,4 +528,4 @@ - + \ No newline at end of file From 09c407f99207aa37509cfcbc08a33e3aac830011 Mon Sep 17 00:00:00 2001 From: Zedifus Date: Sun, 14 Aug 2022 17:40:40 +0100 Subject: [PATCH 2/2] Update changelog !424 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13b639e3..0cef6b3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ TBD - Fix reaction tasks not firing ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/423)) - QOL task delay offset not following over on task edit ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/423)) ### Tweaks +- Session Handling | Logout on browser close ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/424)) ### Lang TBD