Skip to content

Commit

Permalink
Merge pull request alibaba#642 from wuyoushan/fix_jwtAuth_npe
Browse files Browse the repository at this point in the history
fix JwtAuthenticationTokenFilter NPE bug
  • Loading branch information
hxy1991 authored Jan 18, 2019
2 parents 606bd1d + e589b29 commit ed4c41f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public JwtAuthenticationTokenFilter(JwtTokenUtils tokenProvider) {
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException {
String jwt = resolveToken(request);

if (!StringUtils.isEmpty(jwt.trim()) && SecurityContextHolder.getContext().getAuthentication() == null) {
if (jwt != null && !"".equals(jwt.trim()) && SecurityContextHolder.getContext().getAuthentication() == null) {
if (this.tokenProvider.validateToken(jwt)) {
/**
* get auth info
Expand Down

0 comments on commit ed4c41f

Please sign in to comment.