Fixes: U4-2989 Username & password must be changed if login credentials are invalid in order to submit again.

This commit is contained in:
Shannon
2013-09-30 17:03:26 +10:00
parent 1a9ced80f9
commit 0be07f467f

View File

@@ -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;
}