1
0
mirror of synced 2026-08-06 02:08:01 +00:00

Reorder DaoAuthenticationProvider exception logic as per developer list discussion.

This commit is contained in:
Ben Alex
2005-05-18 01:40:45 +00:00
parent ecbfac2ff8
commit cfb8271826
2 changed files with 20 additions and 19 deletions
@@ -237,24 +237,6 @@ public class DaoAuthenticationProvider implements AuthenticationProvider,
}
}
if (!user.isEnabled()) {
if (this.context != null) {
context.publishEvent(new AuthenticationFailureDisabledEvent(
authentication, user));
}
throw new DisabledException("User is disabled");
}
if (!user.isAccountNonExpired()) {
if (this.context != null) {
context.publishEvent(new AuthenticationFailureAccountExpiredEvent(
authentication, user));
}
throw new AccountExpiredException("User account has expired");
}
if (!user.isAccountNonLocked()) {
if (this.context != null) {
context.publishEvent(new AuthenticationFailureAccountLockedEvent(
@@ -281,7 +263,25 @@ public class DaoAuthenticationProvider implements AuthenticationProvider,
}
}
if (!user.isCredentialsNonExpired()) {
if (!user.isEnabled()) {
if (this.context != null) {
context.publishEvent(new AuthenticationFailureDisabledEvent(
authentication, user));
}
throw new DisabledException("User is disabled");
}
if (!user.isAccountNonExpired()) {
if (this.context != null) {
context.publishEvent(new AuthenticationFailureAccountExpiredEvent(
authentication, user));
}
throw new AccountExpiredException("User account has expired");
}
if (!user.isCredentialsNonExpired()) {
if (this.context != null) {
context.publishEvent(new AuthenticationFailureCredentialsExpiredEvent(
authentication, user));