mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-12 13:39:01 +08:00
♻️ Refactoring code. security 成功事件健壮性判断
This commit is contained in:
1 parent
ef7f08369e
commit
5c0dadb6f6
1 file changed
+5
-5
+5
-5
@@ -45,13 +45,13 @@ public class AuthenticationSuccessEventListener implements ApplicationListener<A
|
||||
*/
|
||||
@Override
|
||||
public void onApplicationEvent(AuthenticationSuccessEvent event) {
|
||||
ServletRequestAttributes requestAttributes = (ServletRequestAttributes)
|
||||
RequestContextHolder.getRequestAttributes();
|
||||
HttpServletRequest request = requestAttributes.getRequest();
|
||||
HttpServletResponse response = requestAttributes.getResponse();
|
||||
|
||||
Authentication authentication = (Authentication) event.getSource();
|
||||
if (CollUtil.isNotEmpty(authentication.getAuthorities()) && successHandler != null) {
|
||||
ServletRequestAttributes requestAttributes = (ServletRequestAttributes)
|
||||
RequestContextHolder.getRequestAttributes();
|
||||
HttpServletRequest request = requestAttributes.getRequest();
|
||||
HttpServletResponse response = requestAttributes.getResponse();
|
||||
|
||||
successHandler.handle(authentication, request, response);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user