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