Skip to content

Commit

Permalink
Update jquery-idleTimeout-plus.js
Browse files Browse the repository at this point in the history
Reversed test on keepAliveResponse to check for false first
Set default to false for keepAliveResponse
  • Loading branch information
CrashSensei authored Mar 20, 2018
1 parent 05375ac commit 7ea199a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/jquery-idleTimeout-plus.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
keepAliveUrl: window.location.href, // set URL to ping - does not apply if keepAliveInterval: false
keepAliveAjaxType: 'GET',
keepAliveAjaxData: '',
keepAliveResponse: 'OK', // add ability to check keep alive's response. if user was logged out by other means, or something went wrong, redirect to keepAliveBadUrl - Set to false to disable KeepAliveBadUrl redirection
keepAliveBadUrl: window.location.href, // set URL to redirect to if keepAliveResponse wasnt what was expected and if keepAliveResponse isn't set to false
keepAliveResponse: false, // add ability to check keep alive's response. if user was logged out by other means, or something went wrong, redirect to keepAliveBadUrl - Set to false to disable KeepAliveBadUrl redirection
keepAliveBadUrl: window.location.href, // set URL to redirect to if keepAliveResponse wasn't what was expected and if keepAliveResponse isn't set to false

// Lock Screen settings
lockEnabled: false, // Set to true to enable lock screen before redirecting
Expand Down Expand Up @@ -425,7 +425,7 @@
url: config.keepAliveUrl,
data: config.keepAliveAjaxData,
success: function(response){
if($.trim(response) !== config.keepAliveResponse && config.keepAliveResponse !== false){
if(config.keepAliveResponse !== false && $.trim(response) !== config.keepAliveResponse){
window.location.replace(config.keepAliveBadUrl);
}
}
Expand Down

0 comments on commit 7ea199a

Please sign in to comment.