Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void handle(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException {
- String targetUrl = SecurityUtils.getStartPath(authentication);
- if (response.isCommitted()) {
- return;
- }
- Collection<? extends GrantedAuthority> authorities = authentication.getAuthorities();
- if (authorities.contains(new SimpleGrantedAuthority("SUPERVISOR"))) {
- redirectStrategy.sendRedirect(request, response, "/supervisor");
- } else {
- redirectStrategy.sendRedirect(request, response, targetUrl);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement