mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUACAMOLE-742: Disable login form after credentials have been submitted.
This commit is contained in:
@@ -91,6 +91,16 @@ angular.module('login').directive('guacLogin', [function guacLogin() {
|
||||
*/
|
||||
$scope.remainingFields = [];
|
||||
|
||||
/**
|
||||
* Whether an authentication attempt has been submitted. This will be
|
||||
* set to true once credentials have been submitted and will only be
|
||||
* reset to false once the attempt has been fully processed, including
|
||||
* rerouting the user to the requested page if the attempt succeeded.
|
||||
*
|
||||
* @type Boolean
|
||||
*/
|
||||
$scope.submitted = false;
|
||||
|
||||
/**
|
||||
* Returns whether a previous login attempt is continuing.
|
||||
*
|
||||
@@ -141,6 +151,9 @@ angular.module('login').directive('guacLogin', [function guacLogin() {
|
||||
*/
|
||||
$scope.login = function login() {
|
||||
|
||||
// Authentication is now in progress
|
||||
$scope.submitted = true;
|
||||
|
||||
// Start with cleared status
|
||||
$scope.loginError = null;
|
||||
|
||||
@@ -156,6 +169,9 @@ angular.module('login').directive('guacLogin', [function guacLogin() {
|
||||
// Reset upon failure
|
||||
['catch'](requestService.createErrorCallback(function loginFailed(error) {
|
||||
|
||||
// Initial submission is complete and has failed
|
||||
$scope.submitted = false;
|
||||
|
||||
// Clear out passwords if the credentials were rejected for any reason
|
||||
if (error.type !== Error.Type.INSUFFICIENT_CREDENTIALS) {
|
||||
|
||||
|
@@ -23,13 +23,24 @@
|
||||
|
||||
<!-- Login fields -->
|
||||
<div class="login-fields">
|
||||
<guac-form namespace="'LOGIN'" content="remainingFields" model="enteredValues"></guac-form>
|
||||
<guac-form
|
||||
namespace="'LOGIN'"
|
||||
content="remainingFields"
|
||||
model="enteredValues"
|
||||
disabled="submitted"></guac-form>
|
||||
</div>
|
||||
|
||||
<!-- Submit button -->
|
||||
<!-- Login/continue button -->
|
||||
<div class="buttons">
|
||||
<input type="submit" name="login" class="login" value="{{'LOGIN.ACTION_LOGIN' | translate}}"/>
|
||||
<input type="submit" name="login" class="continue-login" value="{{'LOGIN.ACTION_CONTINUE' | translate}}"/>
|
||||
|
||||
<input type="submit" name="login" class="login"
|
||||
ng-disabled="submitted"
|
||||
value="{{'LOGIN.ACTION_LOGIN' | translate}}"/>
|
||||
|
||||
<input type="submit" name="login" class="continue-login"
|
||||
ng-disabled="submitted"
|
||||
value="{{'LOGIN.ACTION_CONTINUE' | translate}}"/>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
Reference in New Issue
Block a user