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.
This commit is contained in:
Mathias Rando Juul
2018-02-06 06:35:41 +01:00
parent bd55594be1
commit e0ded863cc

View File

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