2
0
Эх сурвалжийг харах

Fix unit test compatibility if no username provided.

Ben Alex 21 жил өмнө
parent
commit
08ee5deaa9

+ 4 - 0
core/src/main/java/org/acegisecurity/providers/dao/DaoAuthenticationProvider.java

@@ -197,6 +197,10 @@ public class DaoAuthenticationProvider implements AuthenticationProvider,
                 user = getUserFromBackend(username);
             } catch (BadCredentialsException ex) {
                 if (this.context != null) {
+                    if ((username == null) || "".equals(username)) {
+                        username = "NONE_PROVIDED";
+                    }
+
                     context.publishEvent(new AuthenticationFailureUsernameNotFoundEvent(
                             authentication,
                             new User(username, "*****", false,