From e0ded863cc9662c3be826f3bb30af42d62bb1767 Mon Sep 17 00:00:00 2001 From: Mathias Rando Juul Date: Tue, 6 Feb 2018 06:35:41 +0100 Subject: [PATCH] Changes revalidation of username and password. Ensures that both inputs are revalidated on change(if the form is invalid) to avoid cases where changing your password doesn't reset $invalid and therefor doesn't allow you to resubmit the form without triggering a change in the username. --- .../src/views/common/dialogs/login.controller.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/login.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/login.controller.js index 132a698849..331010e3ac 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/login.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/login.controller.js @@ -303,12 +303,14 @@ // while the form is invalid, then revalidate them so that the form can // be submitted again. $scope.loginForm.username.$viewChangeListeners.push(function () { - if ($scope.loginForm.username.$invalid) { + if ($scope.loginForm.$invalid) { $scope.loginForm.username.$setValidity('auth', true); + $scope.loginForm.password.$setValidity('auth', true); } }); $scope.loginForm.password.$viewChangeListeners.push(function () { - if ($scope.loginForm.password.$invalid) { + if ($scope.loginForm.$invalid) { + $scope.loginForm.username.$setValidity('auth', true); $scope.loginForm.password.$setValidity('auth', true); } });