From c2b6099e0d8095451eb6cf695669f04812537491 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Fri, 24 Jun 2016 16:01:46 -0700 Subject: [PATCH] Slight tweak for when session timer expires --- .../authenticationServices/timer.factory.js | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/awx/ui/client/src/login/authenticationServices/timer.factory.js b/awx/ui/client/src/login/authenticationServices/timer.factory.js index 3cb82cbd57..f68d0e412a 100644 --- a/awx/ui/client/src/login/authenticationServices/timer.factory.js +++ b/awx/ui/client/src/login/authenticationServices/timer.factory.js @@ -110,6 +110,23 @@ export default this.clearTimers(); $rootScope.expireTimer = $interval(function() { var idle = that.isIdle(); + if (that.isExpired(true)) { + if($('#idle-modal').is(':visible')){ + if($('#idle-modal').dialog('isOpen')){ + $('#idle-modal').dialog('close'); + } + } + that.expireSession('idle'); + $state.go('signOut'); + return; + } + if(Store('sessionTime') && + Store('sessionTime')[$rootScope.current_user.id] && + Store('sessionTime')[$rootScope.current_user.id].loggedIn === false){ + that.expireSession(); + $state.go('signOut'); + return; + } if(idle !== false){ if($('#idle-modal').is(':visible')){ $('#remaining_seconds').html(Math.round(idle)); @@ -152,20 +169,7 @@ export default $('#idle-modal').dialog('close'); } } - if (that.isExpired(true)) { - if($('#idle-modal').dialog('isOpen')){ - $('#idle-modal').dialog('close'); - } - that.expireSession('idle'); - $state.go('signOut'); - } - if(Store('sessionTime') && - Store('sessionTime')[$rootScope.current_user.id] && - Store('sessionTime')[$rootScope.current_user.id].loggedIn === false){ - that.expireSession(); - $state.go('signOut'); - } }, 1000);