Add an explicit "incorrect password" authentication failure reason

This commit is contained in:
Jon Chambers 2024-06-10 14:38:27 -04:00 committed by Jon Chambers
parent 0871d6ebc1
commit 138b368951
1 changed files with 3 additions and 2 deletions

View File

@ -108,9 +108,10 @@ public class AccountAuthenticator implements Authenticator<BasicCredentials, Aut
SaltedTokenHash.generateFor(basicCredentials.getPassword())); // new credentials have current version
}
return Optional.of(new AuthenticatedAccount(authenticatedAccount, device.get()));
} else {
failureReason = "incorrectPassword";
return Optional.empty();
}
return Optional.empty();
} catch (IllegalArgumentException | InvalidAuthorizationHeaderException iae) {
failureReason = "invalidHeader";
return Optional.empty();