Fix issue #889 - Security: login dialog

This commit is contained in:
Robin Shen 2022-08-26 20:38:14 +08:00
parent 0e52b32cae
commit a2fee5a6ac
2 changed files with 4 additions and 6 deletions

View File

@ -174,10 +174,10 @@ public class PasswordAuthorizingRealm extends AbstractAuthorizingRealm {
return newUser(userNameOrEmailAddressValue, authenticated, authenticator.getDefaultGroup());
}
} else {
throw new UnknownAccountException("Unknown user");
throw new UnknownAccountException("Invalid credentials");
}
} else {
throw new UnknownAccountException("Unknown user");
throw new UnknownAccountException("Invalid credentials");
}
} catch (Exception e) {
if (e instanceof AuthenticationException) {

View File

@ -100,10 +100,8 @@ public class LoginPage extends SimplePage {
} else {
afterLogin(user);
}
} catch (IncorrectCredentialsException e) {
error("Incorrect credentials");
} catch (UnknownAccountException e) {
error("Unknown user name");
} catch (IncorrectCredentialsException|UnknownAccountException e) {
error("Invalid credentials");
} catch (AuthenticationException ae) {
error(ae.getMessage());
}