From efd60540503cd0d71cae3e6de3160cbc32362b6c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 29 Sep 2020 11:43:00 +0200 Subject: [PATCH] Bug 26562: [19.05.x] Removes 'searches' from localStorage on logout A user recently logged in will inherit the "searches" item stored in localStorage. To recreate: Log in with user A, do some searches Note that the "searches" item is filled in with the search queries Logout and log in with user B Note that the "searches" item is still there Signed-off-by: Victor Grousset/tuxayo --- koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt | 3 +++ koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 1 + 2 files changed, 4 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt index 4d73d26355..86db48ff66 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt @@ -126,6 +126,9 @@ if ( document.location.hash ) { $( '#loginform' ).append( '' ); } + + // Clear last borrowers, rememberd sql reports, carts, etc. + logOut(); }); [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index 70e0551b8f..770edba7db 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -147,6 +147,7 @@ function logOut(){ delBasket('main', true); } clearHoldFor(); + localStorage.removeItem("searches"); } function openHelp(){ -- 2.39.5