mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUAC-1161: Convert login page to directive which accepts a dynamic form. Display login directive when credentials are needed.
This commit is contained in:
@@ -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) {
|
||||
|
||||
|
Reference in New Issue
Block a user