From b29abf38ebb04ade1aa61f200a3e767c17c37fb4 Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Mon, 29 Jul 2013 13:35:56 -0400 Subject: [PATCH] AC-292 Fixed time-out message on login dialog to only display if user has not already logged out. --- awx/ui/static/js/controllers/Authentication.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/awx/ui/static/js/controllers/Authentication.js b/awx/ui/static/js/controllers/Authentication.js index b4383dc4c1..b1b4bcf025 100644 --- a/awx/ui/static/js/controllers/Authentication.js +++ b/awx/ui/static/js/controllers/Authentication.js @@ -19,13 +19,20 @@ function Authenticate($window, $scope, $rootScope, $location, Authorization, Tog Authorization.logout(); } - $rootScope.userLoggedIn = false; //hide the logout link. if you got here, your logged out. - //gets set back to true by Authorization.setToken(). - - $scope.sessionExpired = Authorization.didSessionExpire(); //Display session timeout message $scope.sessionTimeout = ($AnsibleConfig.session_timeout / 60).toFixed(2); $scope.AWXLoginLogo = $staticURL + 'img/AWX_logo.png'; + if ($rootScope.userLoggedIn) { + // If we're logged in, check for session timeout + $scope.sessionExpired = Authorization.didSessionExpire(); + } + else { + $scope.sessionExpired = false; + } + + $rootScope.userLoggedIn = false; //hide the logout link. if you got here, your logged out. + //gets set back to true by Authorization.setToken(). + $('#login-password').bind('keypress', function(e) { var code = (e.keyCode ? e.keyCode : e.which); if (code == 13) {