Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Going to saved RedirectUrl now works after login.

  • Loading branch information...
commit e494650a5899ed750e2203fcb534cbd86c2d95bc 1 parent d393c68
@hirokiterashima hirokiterashima authored
View
7 src/main/java/org/telscenter/sail/webapp/presentation/web/filters/TelsAuthenticationSuccessHandler.java
@@ -35,6 +35,8 @@
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
+import org.springframework.security.web.savedrequest.HttpSessionRequestCache;
+import org.springframework.security.web.savedrequest.SavedRequest;
import org.springframework.util.StringUtils;
import org.telscenter.sail.webapp.domain.authentication.MutableUserDetails;
import org.telscenter.sail.webapp.domain.authentication.impl.StudentUserDetails;
@@ -117,7 +119,10 @@ else if (userDetails instanceof TeacherUserDetails) {
}
/* redirect if specified in the login request */
- String redirectUrl = request.getParameter("redirect");
+ SavedRequest savedRequest =
+ new HttpSessionRequestCache().getRequest(request, response);
+ String redirectUrl = savedRequest.getRedirectUrl();
+ //String redirectUrl = request.getParameter("redmrect");
if(StringUtils.hasText(redirectUrl)){
this.setDefaultTargetUrl(redirectUrl);
}
Please sign in to comment.
Something went wrong with that request. Please try again.