Clear login interface if login was either successful or implicitly not required.
@@ -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)
