在学springSecurity,中间遇到一个问题无法理解,请教各位

在 自定义jwt过滤器中,有这么一段代码:
UsernamePasswordAuthenticationToken authenticationToken =
new UsernamePasswordAuthenticationToken(userDetails,null,userDetails.getAuthorities());
authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
SecurityContextHolder.getContext().setAuthentication(authenticationToken);

其中“authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));” 是什么意思,不写会有什么后果

往认证token里面设置一些详情信息,要看你的系统后续有没有使用到这些信息,如果没有使用到,不写没啥关系。