mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 13:41:21 +00:00
GUAC-1176: Handle insufficient credentials distinctly from invalid credentials.
This commit is contained in:
@@ -36,11 +36,22 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
|
||||
*/
|
||||
$scope.guacNotification = guacNotification;
|
||||
|
||||
/**
|
||||
* The credentials that the authentication service is has already accepted,
|
||||
* pending additional credentials, if any. If the user is logged in, or no
|
||||
* credentials have been accepted, this will be null. If credentials have
|
||||
* been accepted, this will be a map of name/value pairs corresponding to
|
||||
* the parameters submitted in a previous authentication attempt.
|
||||
*
|
||||
* @type Object.<String, String>
|
||||
*/
|
||||
$scope.acceptedCredentials = null;
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @type Field[]
|
||||
*/
|
||||
$scope.expectedCredentials = null;
|
||||
|
||||
@@ -112,6 +123,7 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
|
||||
$scope.$on('guacInvalidCredentials', function loginInvalid(event, parameters, expected) {
|
||||
$scope.page.title = 'APP.NAME';
|
||||
$scope.page.bodyClassName = '';
|
||||
$scope.acceptedCredentials = {};
|
||||
$scope.expectedCredentials = expected;
|
||||
});
|
||||
|
||||
@@ -119,11 +131,13 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
|
||||
$scope.$on('guacInsufficientCredentials', function loginInsufficient(event, parameters, expected) {
|
||||
$scope.page.title = 'APP.NAME';
|
||||
$scope.page.bodyClassName = '';
|
||||
$scope.acceptedCredentials = parameters;
|
||||
$scope.expectedCredentials = expected;
|
||||
});
|
||||
|
||||
// Clear login screen if login was successful
|
||||
$scope.$on('guacLogin', function loginSuccessful() {
|
||||
$scope.acceptedCredentials = null;
|
||||
$scope.expectedCredentials = null;
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user