Skip to content

Commit

Permalink
Add ability to submit LDAP sign-in form on invite acceptance
Browse files Browse the repository at this point in the history
[#127014231] https://www.pivotaltracker.com/story/show/127014231

Signed-off-by: Priyata Agrawal <pagrawal@pivotal.io>
  • Loading branch information
Jeremy Coffield authored and Priyata25 committed Aug 5, 2016
1 parent a39d00f commit d763183
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorator="layouts/main">
layout:decorator="layouts/main" th:with="isLdap=${ldap!=null}">
<div class="island-landscape" layout:fragment="page-content">
<div class="island-title">
<h1>Create your <th:block th:text="${!companyName.equals('Cloud Foundry') and isUaa ? (companyName + ' account') : 'account'}">account</th:block></h1>
<h1><th:block th:unless="${isLdap}">Create</th:block><th:block th:if="${isLdap}">Link</th:block> your <th:block th:text="${!companyName.equals('Cloud Foundry') and isUaa ? (companyName + ' account') : 'account'}">account</th:block></h1>
</div>
<div class="island-content">
<div th:text="|Email: ${email}|" th:unless="${error_message_code == 'code_expired'}" class="email-display">Email: user@example.com</div>
Expand All @@ -23,12 +23,13 @@ <h1>Create your <th:block th:text="${!companyName.equals('Cloud Foundry') and is
<input type="submit" th:value="${!companyName.equals('Cloud Foundry') and isUaa ? 'Create ' + companyName + ' account' : 'Create account'}" class="island-button"/>
</form>
</th:block>
<th:block th:if="${ldap != null}">
<th:block th:if="${isLdap}">
<p>Sign in with enterprise credentials: </p>
<form th:action="@{/invitations/accept_enterprise.do}" method="post" novalidate="novalidate">
<input name="code" type="hidden" value="code" th:value="${code}"/>
<input name="enterprise_username" type="text" placeholder="Username" autocomplete="off" class="form-control"/>
<input name="enterprise_password" type="password" placeholder="Password" autocomplete="off" class="form-control"/>
<input type="submit" value="Sign in" class="island-button"/>
</form>
</th:block>
</th:block>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,11 @@ public void acceptInvitation_for_ldap_user_whose_username_is_not_email() throws
.header("Host", zone.getZone().getIdentityZone().getSubdomain() + ".localhost")
);
MvcResult result = actions.andExpect(status().isOk())
.andExpect(content().string(containsString("Link your account")))
.andExpect(content().string(containsString("Email: " + email)))
.andExpect(content().string(containsString("Sign in with enterprise credentials:")))
.andExpect(content().string(containsString("username")))
.andExpect(content().string(containsString("<input type=\"submit\" value=\"Sign in\" class=\"island-button\" />")))
.andReturn();

code = mainContext.getBean(JdbcTemplate.class).queryForObject("select code from expiring_code_store", String.class);
Expand Down

0 comments on commit d763183

Please sign in to comment.