File tree 2 files changed +14
-2
lines changed
java/org/springframework/security/authentication
resources/org/springframework/security 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
package org .springframework .security .authentication ;
17
17
18
+ import org .springframework .context .MessageSource ;
19
+ import org .springframework .context .MessageSourceAware ;
18
20
import org .springframework .security .core .SpringSecurityMessageSource ;
19
21
import org .springframework .security .core .userdetails .UserDetails ;
20
22
import org .springframework .security .core .userdetails .UserDetailsChecker ;
21
23
import org .springframework .context .support .MessageSourceAccessor ;
24
+ import org .springframework .util .Assert ;
22
25
23
26
/**
24
27
* @author Luke Taylor
25
28
*/
26
- public class AccountStatusUserDetailsChecker implements UserDetailsChecker {
29
+ public class AccountStatusUserDetailsChecker implements UserDetailsChecker , MessageSourceAware {
27
30
28
- protected final MessageSourceAccessor messages = SpringSecurityMessageSource
31
+ protected MessageSourceAccessor messages = SpringSecurityMessageSource
29
32
.getAccessor ();
30
33
31
34
public void check (UserDetails user ) {
@@ -51,4 +54,13 @@ public void check(UserDetails user) {
51
54
"User credentials have expired" ));
52
55
}
53
56
}
57
+
58
+ /**
59
+ * @since 5.2
60
+ */
61
+ @ Override
62
+ public void setMessageSource (MessageSource messageSource ) {
63
+ Assert .notNull (messageSource , "messageSource cannot be null" );
64
+ this .messages = new MessageSourceAccessor (messageSource );
65
+ }
54
66
}
You can’t perform that action at this time.
0 commit comments