add null check
This commit is contained in:
+3
-1
@@ -14,6 +14,8 @@ public class AuthenticationFailureListener implements ApplicationListener<Authen
|
||||
|
||||
public void onApplicationEvent(AuthenticationFailureBadCredentialsEvent e) {
|
||||
WebAuthenticationDetails auth = (WebAuthenticationDetails) e.getAuthentication().getDetails();
|
||||
loginAttemptService.loginFailed(auth.getRemoteAddress());
|
||||
if (auth != null) {
|
||||
loginAttemptService.loginFailed(auth.getRemoteAddress());
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -14,6 +14,8 @@ public class AuthenticationSuccessEventListener implements ApplicationListener<A
|
||||
|
||||
public void onApplicationEvent(AuthenticationSuccessEvent e) {
|
||||
WebAuthenticationDetails auth = (WebAuthenticationDetails) e.getAuthentication().getDetails();
|
||||
loginAttemptService.loginSucceeded(auth.getRemoteAddress());
|
||||
if (auth != null) {
|
||||
loginAttemptService.loginSucceeded(auth.getRemoteAddress());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user