GUACAMOLE-301: Clear login interface if login was either successful or implicitly not required.

This commit is contained in:
Michael Jumper
2017-05-07 18:38:43 -07:00
parent d9b888e99a
commit d649f0b955

View File

@@ -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)