JBAS-1665 SCKO return-to timeout before login
authorBill Erickson <berickxx@gmail.com>
Wed, 8 Mar 2017 20:13:25 +0000 (15:13 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Allow SCKO to timeout and return to the return-to URL (if set) even
if the patron login process never completes.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/web/js/ui/kcls/circ/selfcheck/selfcheck.js

index fb5cc17..8b42dc2 100644 (file)
@@ -64,7 +64,7 @@ function selfckResetTimer() {
     console.log('Starting new login timer');
             
     // do not show a warning dialog if the inactivity timeout
-    // occurs between entering a barcode and password.
+    // occurs during the login stage.
     selfckStartTimer(!Boolean(selfCheckManager.patron));
 }
 
@@ -1615,5 +1615,12 @@ openils.Util.addOnLoad(
         selfCheckManager.init();
                openils.Util.registerEnterHandler(dojo.byId('patron-login-username'), function(){checkLogin();});
                openils.Util.registerEnterHandler(dojo.byId('patron-login-password'), function(){selfCheckMgr.loginPatron(dojo.byId('patron-login-username').value,dojo.byId('patron-login-password').value);});
+
+        // If we have a return-to address, start the login timer
+        // before the patron logs in, so we can revert back to
+        // our return-to page if the patron never logs in.
+        if (selfCheckManager.cgi.param('return-to')) {
+            selfckResetTimer();
+        }
     }
 );