mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-12 13:23:29 +00:00
Proper handling if the account is no longer allowed login.
This commit is contained in:
parent
748f427a80
commit
07e46fe4d5
@ -222,6 +222,18 @@ public class TokenBasedRememberMeServices implements RememberMeServices,
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Immediately reject if the user is not allowed to login
|
||||||
|
if (!userDetails.isAccountNonExpired()
|
||||||
|
|| !userDetails.isCredentialsNonExpired()
|
||||||
|
|| !userDetails.isEnabled()) {
|
||||||
|
cancelCookie(request, response,
|
||||||
|
"Cookie token[0] contained username '"
|
||||||
|
+ cookieTokens[0]
|
||||||
|
+ "' but account has expired, credentials have expired, or user is disabled");
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// Check signature of token matches remaining details
|
// Check signature of token matches remaining details
|
||||||
// Must do this after user lookup, as we need the DAO-derived password
|
// Must do this after user lookup, as we need the DAO-derived password
|
||||||
// If efficiency was a major issue, just add in a UserCache implementation,
|
// If efficiency was a major issue, just add in a UserCache implementation,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user