From 3b5e3a30cd7f781c064d9cc5eaa0d36a2370844e Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Sun, 7 Aug 2022 11:04:56 -0400 Subject: [PATCH] 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