mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-26 13:53:14 +00:00
Polish ForwardAuthenticationSuccessHandler
* Whitespace cleanup * Add @since Issue gh-3726
This commit is contained in:
parent
e61bc7e93b
commit
6cbb1dc881
@ -30,6 +30,7 @@ import java.io.IOException;
|
|||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author Shazin Sadakath
|
* @author Shazin Sadakath
|
||||||
|
* @since 4.1
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ForwardAuthenticationSuccessHandler implements AuthenticationSuccessHandler {
|
public class ForwardAuthenticationSuccessHandler implements AuthenticationSuccessHandler {
|
||||||
@ -40,13 +41,12 @@ public class ForwardAuthenticationSuccessHandler implements AuthenticationSucces
|
|||||||
* @param forwardUrl
|
* @param forwardUrl
|
||||||
*/
|
*/
|
||||||
public ForwardAuthenticationSuccessHandler(String forwardUrl) {
|
public ForwardAuthenticationSuccessHandler(String forwardUrl) {
|
||||||
Assert.isTrue(UrlUtils.isValidRedirectUrl(forwardUrl), "'"
|
Assert.isTrue(UrlUtils.isValidRedirectUrl(forwardUrl), "'"
|
||||||
+ forwardUrl + "' is not a valid forward URL");
|
+ forwardUrl + "' is not a valid forward URL");
|
||||||
this.forwardUrl = forwardUrl;
|
this.forwardUrl = forwardUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
|
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
|
||||||
request.getRequestDispatcher(forwardUrl).forward(request, response);
|
request.getRequestDispatcher(forwardUrl).forward(request, response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.*;
|
|||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author Shazin Sadakath
|
* @author Shazin Sadakath
|
||||||
*
|
* @since 4.1
|
||||||
*/
|
*/
|
||||||
public class ForwardAuthenticaionSuccessHandlerTests {
|
public class ForwardAuthenticaionSuccessHandlerTests {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user