/** * Set the url to redirect to if the user logs in directly at the url of the form login handler * without being redirected here first * @param directLoggedInOKURL the URL to redirect to * @return a reference to this for a fluent API */ public io.vertx.rxjava.ext.web.handler.FormLoginHandler setDirectLoggedInOKURL(String directLoggedInOKURL) { delegate.setDirectLoggedInOKURL(directLoggedInOKURL); return this; }
/** * Set the url to redirect to if the user logs in directly at the url of the form login handler * without being redirected here first * @param directLoggedInOKURL the URL to redirect to * @return a reference to this for a fluent API */ public io.vertx.rxjava.ext.web.handler.FormLoginHandler setDirectLoggedInOKURL(String directLoggedInOKURL) { delegate.setDirectLoggedInOKURL(directLoggedInOKURL); return this; }
@Test public void testFormLoginHandlerDirectSpecifyLoggedInURL() throws Exception { formLoginHandler = FormLoginHandler.create(authProvider); usernameParam = "username2"; passwordParam ="password2"; String loggedInDirectOKPage = "/youloggedinokpage.html"; formLoginHandler.setUsernameParam(usernameParam).setPasswordParam(passwordParam).setDirectLoggedInOKURL(loggedInDirectOKPage); router.route().handler(LoggerHandler.create()); router.route().handler(BodyHandler.create()); router.route().handler(CookieHandler.create()); router.route("/login").handler(formLoginHandler); testRequest(HttpMethod.POST, "/login", sendLoginRequestConsumer(), resp -> { String location = resp.headers().get("location"); assertNotNull(location); assertEquals(loggedInDirectOKPage, location); }, 302, "Found", null); }
@Test public void testFormLoginHandlerDirectSpecifyLoggedInURL() throws Exception { formLoginHandler = FormLoginHandler.create(authProvider); usernameParam = "username2"; passwordParam ="password2"; String loggedInDirectOKPage = "/youloggedinokpage.html"; formLoginHandler.setUsernameParam(usernameParam).setPasswordParam(passwordParam).setDirectLoggedInOKURL(loggedInDirectOKPage); router.route().handler(LoggerHandler.create()); router.route().handler(BodyHandler.create()); router.route().handler(CookieHandler.create()); router.route("/login").handler(formLoginHandler); testRequest(HttpMethod.POST, "/login", sendLoginRequestConsumer(), resp -> { String location = resp.headers().get("location"); assertNotNull(location); assertEquals(loggedInDirectOKPage, location); }, 302, "Found", null); }