Browse Source

Polish ForwardAuthenticationSuccessHandler

* Whitespace cleanup
* Add @since

Issue gh-3726
pull/257/merge
Rob Winch 10 years ago
parent
commit
6cbb1dc881
  1. 10
      web/src/main/java/org/springframework/security/web/authentication/ForwardAuthenticationSuccessHandler.java
  2. 2
      web/src/test/java/org/springframework/security/web/authentication/ForwardAuthenticaionSuccessHandlerTests.java

10
web/src/main/java/org/springframework/security/web/authentication/ForwardAuthenticationSuccessHandler.java

@ -30,6 +30,7 @@ import java.io.IOException; @@ -30,6 +30,7 @@ import java.io.IOException;
* </p>
*
* @author Shazin Sadakath
* @since 4.1
*
*/
public class ForwardAuthenticationSuccessHandler implements AuthenticationSuccessHandler {
@ -40,13 +41,12 @@ public class ForwardAuthenticationSuccessHandler implements AuthenticationSucces @@ -40,13 +41,12 @@ public class ForwardAuthenticationSuccessHandler implements AuthenticationSucces
* @param forwardUrl
*/
public ForwardAuthenticationSuccessHandler(String forwardUrl) {
Assert.isTrue(UrlUtils.isValidRedirectUrl(forwardUrl), "'"
+ forwardUrl + "' is not a valid forward URL");
this.forwardUrl = forwardUrl;
Assert.isTrue(UrlUtils.isValidRedirectUrl(forwardUrl), "'"
+ forwardUrl + "' is not a valid forward URL");
this.forwardUrl = forwardUrl;
}
@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
request.getRequestDispatcher(forwardUrl).forward(request, response);
}
}
}

2
web/src/test/java/org/springframework/security/web/authentication/ForwardAuthenticaionSuccessHandlerTests.java

@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.*; @@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.*;
* </p>
*
* @author Shazin Sadakath
*
* @since 4.1
*/
public class ForwardAuthenticaionSuccessHandlerTests {

Loading…
Cancel
Save