jmuehlner commented on code in PR #815:
URL: https://github.com/apache/guacamole-client/pull/815#discussion_r1145548819
##########
guacamole/src/main/frontend/src/app/index/controllers/indexController.js:
##########
@@ -323,6 +329,25 @@ angular.module('index').controller('indexController',
['$scope', '$injector',
});
+ // Alert user to authentication errors that occur in the absence of an
+ // interactive login form
+ $scope.$on('guacLoginFailed', function loginFailed(event, parameters,
error) {
+
+ // All errors related to an interactive login form are handled
elsewhere
+ if ($scope.applicationState === ApplicationState.AWAITING_CREDENTIALS
+ || error.type === Error.Type.INSUFFICIENT_CREDENTIALS
+ || error.type === Error.Type.INVALID_CREDENTIALS)
+ return;
+
+ $scope.applicationState = ApplicationState.AUTOMATIC_LOGIN_REJECTED;
+ $scope.page.title = 'APP.NAME';
+ $scope.page.bodyClassName = '';
Review Comment:
I see these 2 lines duplicated in 4 different places in this controller.
Maybe time to create a common function or something? It would be more DRY and
make it a bit easier to know what these do / are for.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]