GUAC-1161: Convert login page to directive which accepts a dynamic form. Display login directive when credentials are needed.

This commit is contained in:
Michael Jumper
2015-04-21 12:02:01 -07:00
parent 872aa38498
commit f29a24ad68
12 changed files with 214 additions and 221 deletions

View File

@@ -36,6 +36,14 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
*/
$scope.guacNotification = guacNotification;
/**
* The credentials that the authentication service is currently expecting,
* if any. If the user is logged in, this will be null.
*
* @type Form[]|Form|Field[]|Field
*/
$scope.expectedCredentials = null;
/**
* Basic page-level information.
*/
@@ -92,6 +100,21 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
keyboard.reset();
};
// Display login screen if a whole new set of credentials is needed
$scope.$on('guacInvalidCredentials', function loginInvalid(event, parameters, expected) {
$scope.expectedCredentials = expected;
});
// Prompt for remaining credentials if provided credentials were not enough
$scope.$on('guacInsufficientCredentials', function loginInsufficient(event, parameters, expected) {
// TODO: Implement insufficient credential prompting
});
// Clear login screen if login was successful
$scope.$on('guacLogin', function loginSuccessful() {
$scope.expectedCredentials = null;
});
// Update title and CSS class upon navigation
$scope.$on('$routeChangeSuccess', function(event, current, previous) {