Merge branch '5.8.x' into 6.1.x
This commit is contained in:
commit
1b8cf6cc55
|
@ -19,8 +19,6 @@ package org.springframework.security.crypto.password;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.springframework.util.StringUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A password encoder that delegates to another PasswordEncoder based upon a prefixed
|
* A password encoder that delegates to another PasswordEncoder based upon a prefixed
|
||||||
* identifier.
|
* identifier.
|
||||||
|
@ -292,7 +290,7 @@ public class DelegatingPasswordEncoder implements PasswordEncoder {
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(CharSequence rawPassword, String prefixEncodedPassword) {
|
public boolean matches(CharSequence rawPassword, String prefixEncodedPassword) {
|
||||||
String id = extractId(prefixEncodedPassword);
|
String id = extractId(prefixEncodedPassword);
|
||||||
if (StringUtils.hasText(id)) {
|
if (id != null && !id.isEmpty()) {
|
||||||
throw new IllegalArgumentException(String.format(NO_PASSWORD_ENCODER_MAPPED, id));
|
throw new IllegalArgumentException(String.format(NO_PASSWORD_ENCODER_MAPPED, id));
|
||||||
}
|
}
|
||||||
throw new IllegalArgumentException(NO_PASSWORD_ENCODER_PREFIX);
|
throw new IllegalArgumentException(NO_PASSWORD_ENCODER_PREFIX);
|
||||||
|
|
Loading…
Reference in New Issue