Skip to content
This repository was archived by the owner on Nov 11, 2019. It is now read-only.

Commit ff64c22

Browse files
committed
Move logic into getKey()
1 parent cbea2e1 commit ff64c22

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

config/src/main/java/org/springframework/security/config/annotation/web/configurers/RememberMeConfigurer.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,6 @@ public void init(H http) throws Exception {
267267
validateInput();
268268
String key = getKey();
269269
RememberMeServices rememberMeServices = getRememberMeServices(http, key);
270-
if (key == null) {
271-
if (rememberMeServices instanceof AbstractRememberMeServices) {
272-
key = ((AbstractRememberMeServices) rememberMeServices).getKey();
273-
}
274-
}
275270
http.setSharedObject(RememberMeServices.class, rememberMeServices);
276271
LogoutConfigurer<H> logoutConfigurer = http.getConfigurer(LogoutConfigurer.class);
277272
if (logoutConfigurer != null && this.logoutHandler != null) {
@@ -441,6 +436,9 @@ private UserDetailsService getUserDetailsService(H http) {
441436
* @return the remember me key to use
442437
*/
443438
private String getKey() {
439+
if (this.key == null && this.rememberMeServices instanceof AbstractRememberMeServices) {
440+
this.key = ((AbstractRememberMeServices) rememberMeServices).getKey();
441+
}
444442
if (this.key == null) {
445443
this.key = UUID.randomUUID().toString();
446444
}

0 commit comments

Comments
 (0)