Revision 59340
Added by Konstantinos Triantafyllou over 3 years ago
AuthorizationFilter.java | ||
---|---|---|
37 | 37 |
HttpServletRequest request = (HttpServletRequest) req; |
38 | 38 |
String token = utils.getToken(request); |
39 | 39 |
if (token != null) { |
40 |
System.out.println(token); |
|
40 | 41 |
Authentication auth = authorizationProvider.getAuthentication(token); |
41 | 42 |
SecurityContextHolder.getContext().setAuthentication(auth); |
42 |
} else { |
|
43 |
HttpServletResponse response = (HttpServletResponse) res; |
|
44 |
response.sendError(HttpStatus.UNAUTHORIZED.value(), "No token has been found"); |
|
45 |
return; |
|
46 | 43 |
} |
47 | 44 |
filterChain.doFilter(req, res); |
48 | 45 |
} |
Also available in: Unified diff
Fix some issues. Remove origins temporaly