From 0be07f467fdd085238b0fa7602e4d43a146d8326 Mon Sep 17 00:00:00 2001 From: Shannon Date: Mon, 30 Sep 2013 17:03:26 +1000 Subject: [PATCH] Fixes: U4-2989 Username & password must be changed if login credentials are invalid in order to submit again. --- .../src/views/common/dialogs/login.controller.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 f6cf8b6e41..e42a2aa479 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 @@ -16,6 +16,16 @@ $scope.errorMsg = ""; $scope.loginSubmit = function (login, password) { + //if the login and password are not empty we need to automatically + // validate them - this is because if there are validation errors on the server + // then the user has to change both username & password to resubmit which isn't ideal, + // so if they're not empty , we'l just make sure to set them to valid. + if (login && password && login.length > 0 && password.length > 0) { + $scope.loginForm.username.$setValidity('auth', true); + $scope.loginForm.password.$setValidity('auth', true); + } + + if ($scope.loginForm.$invalid) { return; }