Skip to content

Commit

Permalink
HTML markup fixed in DefaultLoginPageGeneratingFilter
Browse files Browse the repository at this point in the history
Ending div moved  out of condition.

Fixes: gh-6417
  • Loading branch information
ankurpathak committed Jan 18, 2019
1 parent b7ed919 commit 409465a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public class DefaultLoginPageConfigurerTests extends BaseSpringSpec {
<input name="${csrfToken.parameterName}" type="hidden" value="${csrfToken.token}" />
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
</div>
</body></html>"""
when: "fail to log in"
super.setup()
Expand Down Expand Up @@ -121,6 +122,7 @@ public class DefaultLoginPageConfigurerTests extends BaseSpringSpec {
<input name="${csrfToken.parameterName}" type="hidden" value="${csrfToken.token}" />
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
</div>
</body></html>"""
when: "login success"
super.setup()
Expand Down Expand Up @@ -168,6 +170,7 @@ public class DefaultLoginPageConfigurerTests extends BaseSpringSpec {
<input name="${csrfToken.parameterName}" type="hidden" value="${csrfToken.token}" />
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
</div>
</body></html>"""
}

Expand Down Expand Up @@ -272,6 +275,7 @@ public class DefaultLoginPageConfigurerTests extends BaseSpringSpec {
<input name="${csrfToken.parameterName}" type="hidden" value="${csrfToken.token}" />
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
</div>
</body></html>"""
}

Expand Down Expand Up @@ -318,6 +322,7 @@ public class DefaultLoginPageConfigurerTests extends BaseSpringSpec {
<input name="${csrfToken.parameterName}" type="hidden" value="${csrfToken.token}" />
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
</div>
</body></html>"""
}

Expand Down Expand Up @@ -377,6 +382,7 @@ public class DefaultLoginPageConfigurerTests extends BaseSpringSpec {
<input name="${csrfToken.parameterName}" type="hidden" value="${csrfToken.token}" />
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
</div>
</body></html>"""
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public void getLoginWhenAutoConfigThenShowsDefaultLoginPage()
+ " </p>\n"
+ " <button class=\"btn btn-lg btn-primary btn-block\" type=\"submit\">Sign in</button>\n"
+ " </form>\n"
+ "</div>\n"
+ "</body></html>";

this.mvc.perform(get("/login")).andExpect(content().string(expectedContent));
Expand Down Expand Up @@ -126,6 +127,7 @@ public void getLoginWhenConfiguredWithCustomAttributesThenLoginPageReflects()
+ " </p>\n"
+ " <button class=\"btn btn-lg btn-primary btn-block\" type=\"submit\">Sign in</button>\n"
+ " </form>\n"
+ "</div>\n"
+ "</body></html>";

this.mvc.perform(get("/login")).andExpect(content().string(expectedContent));
Expand Down Expand Up @@ -171,6 +173,7 @@ public void getLoginWhenConfiguredForOpenIdThenLoginPageReflects()
+ " </p>\n"
+ " <button class=\"btn btn-lg btn-primary btn-block\" type=\"submit\">Sign in</button>\n"
+ " </form>\n"
+ "</div>\n"
+ "</body></html>";

this.mvc.perform(get("/login")).andExpect(content().string(expectedContent));
Expand Down Expand Up @@ -214,6 +217,7 @@ public void getLoginWhenConfiguredForOpenIdWithCustomAttributesThenLoginPageRefl
+ " </p>\n"
+ " <button class=\"btn btn-lg btn-primary btn-block\" type=\"submit\">Sign in</button>\n"
+ " </form>\n"
+ "</div>\n"
+ "</body></html>";

this.mvc.perform(get("/login")).andExpect(content().string(expectedContent));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ private String generateLoginPageHtml(HttpServletRequest request, boolean loginEr
sb.append("</a>");
sb.append("</td></tr>\n");
}
sb.append("</table></div>\n");
sb.append("</table>\n");
}

sb.append("</div>\n");
sb.append("</body></html>");

return sb.toString();
Expand Down

0 comments on commit 409465a

Please sign in to comment.