diff --git a/guacamole/src/main/webapp/app/index/controllers/indexController.js b/guacamole/src/main/webapp/app/index/controllers/indexController.js index e17ecee1f..0f4d78dc5 100644 --- a/guacamole/src/main/webapp/app/index/controllers/indexController.js +++ b/guacamole/src/main/webapp/app/index/controllers/indexController.js @@ -165,19 +165,18 @@ angular.module('index').controller('indexController', ['$scope', '$injector', $scope.expectedCredentials = error.expected; }); - // Clear login screen if login was successful - $scope.$on('guacLogin', function loginSuccessful() { - $scope.loginHelpText = null; - $scope.acceptedCredentials = null; - $scope.expectedCredentials = null; - }); - // Update title and CSS class upon navigation $scope.$on('$routeChangeSuccess', function(event, current, previous) { // If the current route is available if (current.$$route) { + // Clear login screen if route change was successful (and thus + // login was either successful or not required) + $scope.loginHelpText = null; + $scope.acceptedCredentials = null; + $scope.expectedCredentials = null; + // Set title var title = current.$$route.title; if (title)