Source:
<code>public UserInfo findUserByCredentials(@Nullable WebContext ctx, String user, String password) { if (Strings.isEmpty(password)) { return null; } UserInfo result = findUserByName(ctx, user); if (result == null) { auditLog.negative("AuditLog.lockedOrNonexitentUserTriedLogin").forUser(null, user).log(); return null; } U account = result.getUserObject(getUserClass()); if (account.getUserAccountData().isExternalLoginRequired() && !isWithinInterval(account.getUserAccountData() .getLogin() .getLastExternalLogin(), account.getTenant() .getValue() .getTenantData() .getExternalLoginIntervalDays())) { completeAuditLogForUser(auditLog.negative("AuditLog.externalLoginRequired"), account); throw Exceptions.createHandled().withNLSKey("UserAccount.externalLoginMustBePerformed").handle(); } LoginData loginData = account.getUserAccountData().getLogin(); if (acceptApiTokens && Strings.areEqual(password, loginData.getApiToken())) { completeAuditLogForUser(auditLog.neutral("AuditLog.apiTokenLogin"), account); return result; } LoginData.PasswordVerificationResult pwResult = loginData.checkPassword(password); if (pwResult != LoginData.PasswordVerificationResult.INVALID) { completeAuditLogForUser(auditLog.neutral("AuditLog.passwordLogin"), account); if (pwResult == LoginData.PasswordVerificationResult.VALID_NEEDS_RE_HASH) { return updatePasswordHashing(result, password); } return result; } <START> completeAuditLogForUser(auditLog.negative("AuditLog.loginRejected"), account); <END> return null; }</code><technical_language>This result in a rejection in log caused user. This confusing some people. ("I try login state I so?")</technical_language>

Target:
public UserInfo findUserByCredentials(@Nullable WebContext ctx, String user, String password) { if (Strings.isEmpty(password)) { return null; } UserInfo result = findUserByName(ctx, user); if (result == null) { auditLog.negative("AuditLog.lockedOrNonexitentUserTriedLogin").forUser(null, user).log(); return null; } U account = result.getUserObject(getUserClass()); if (account.getUserAccountData().isExternalLoginRequired() && !isWithinInterval(account.getUserAccountData() .getLogin() .getLastExternalLogin(), account.getTenant() .getValue() .getTenantData() .getExternalLoginIntervalDays())) { completeAuditLogForUser(auditLog.negative("AuditLog.externalLoginRequired"), account); throw Exceptions.createHandled().withNLSKey("UserAccount.externalLoginMustBePerformed").handle(); } LoginData loginData = account.getUserAccountData().getLogin(); if (acceptApiTokens && Strings.areEqual(password, loginData.getApiToken())) { completeAuditLogForUser(auditLog.neutral("AuditLog.apiTokenLogin"), account); return result; } LoginData.PasswordVerificationResult pwResult = loginData.checkPassword(user, password); if (pwResult != LoginData.PasswordVerificationResult.INVALID) { completeAuditLogForUser(auditLog.neutral("AuditLog.passwordLogin"), account); if (pwResult == LoginData.PasswordVerificationResult.VALID_NEEDS_RE_HASH) { return updatePasswordHashing(result, password); } return result; } auditLog.negative("AuditLog.loginRejected") .forTenant(String.valueOf(account.getTenant().getId()), account.getTenant().getValue().getTenantData().getName()) .log(); return null; }