Skip to content

Commit 245733a

Browse files
AnanthaKrishnanJ2001jzheaux
authored andcommitted
fix: restore native form submission for OTT login
Signed-off-by: Anantha Krishnan <ananthakrishnanj2001@gmail.com>
1 parent 229eb3e commit 245733a

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

config/src/test/java/org/springframework/security/config/annotation/web/configurers/ott/OneTimeTokenLoginConfigurerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ void oneTimeTokenWhenConfiguredThenRendersRequestTokenForm() throws Exception {
177177
<input type="text" id="ott-username" name="username" placeholder="Username" required>
178178
</p>
179179
<input name="_csrf" type="hidden" value="%s" />
180-
<button class="primary" type="submit" form="ott-form">Send Token</button>
180+
<button class="primary" type="submit">Send Token</button>
181181
</form>
182182
183183

web/src/main/java/org/springframework/security/web/authentication/ui/DefaultLoginPageGeneratingFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ private boolean matches(HttpServletRequest request, @Nullable String url) {
604604
{{usernameInput}}
605605
</p>
606606
{{hiddenInputs}}
607-
<button class="primary" type="submit" form="ott-form">Send Token</button>
607+
<button class="primary" type="submit">Send Token</button>
608608
</form>
609609
""";
610610

web/src/test/java/org/springframework/security/web/authentication/DefaultLoginPageGeneratingFilterTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public void generateWhenOneTimeTokenLoginThenOttForm() throws Exception {
199199
<input type="text" id="ott-username" name="username" placeholder="Username" required>
200200
</p>
201201
202-
<button class="primary" type="submit" form="ott-form">Send Token</button>
202+
<button class="primary" type="submit">Send Token</button>
203203
</form>
204204
""");
205205
}
@@ -225,7 +225,7 @@ public void generateWhenOneTimeTokenRequestedThenOttForm() throws Exception {
225225
<input type="text" id="ott-username" name="username" placeholder="Username" required>
226226
</p>
227227
228-
<button class="primary" type="submit" form="ott-form">Send Token</button>
228+
<button class="primary" type="submit">Send Token</button>
229229
</form>
230230
""");
231231
assertThat(response.getContentAsString()).doesNotContain("Password");
@@ -254,7 +254,7 @@ public void generateWhenTwoAuthoritiesRequestedThenBothForms() throws Exception
254254
<input type="text" id="ott-username" name="username" placeholder="Username" required>
255255
</p>
256256
257-
<button class="primary" type="submit" form="ott-form">Send Token</button>
257+
<button class="primary" type="submit">Send Token</button>
258258
</form>
259259
""");
260260
assertThat(response.getContentAsString()).contains("Password");

0 commit comments

Comments
 (0)