Hardcode ott-username input name in DefaultLoginPageGeneratingFilter

- GenerateOneTimeTokenFilter uses `"username"`, the default UI should use the same parameter name
This commit is contained in:
Daniel Garnier-Moiroux 2024-09-05 14:07:55 +02:00 committed by Marcus Hert Da Coregio
parent c0a10b90ba
commit 33495441b5
2 changed files with 3 additions and 3 deletions

View File

@ -242,8 +242,8 @@ public class DefaultLoginPageGeneratingFilter extends GenericFilterBean {
sb.append(" <h2>Request a One-Time Token</h2>\n");
sb.append(createError(loginError, errorMsg) + createLogoutSuccess(logoutSuccess) + "<p>\n");
sb.append(" <label for=\"ott-username\" class=\"screenreader\">Username</label>\n");
sb.append(" <input type=\"text\" id=\"ott-username\" name=\"" + this.usernameParameter
+ "\" placeholder=\"Username\" required>\n");
sb.append(
" <input type=\"text\" id=\"ott-username\" name=\"username\" placeholder=\"Username\" required>\n");
sb.append(" </p>\n");
sb.append(renderHiddenInputs(request));
sb.append(" <button class=\"primary\" type=\"submit\" form=\"ott-form\">Send Token</button>\n");

View File

@ -199,7 +199,7 @@ public class DefaultLoginPageGeneratingFilterTests {
<h2>Request a One-Time Token</h2>
<p>
<label for="ott-username" class="screenreader">Username</label>
<input type="text" id="ott-username" name="null" placeholder="Username" required>
<input type="text" id="ott-username" name="username" placeholder="Username" required>
</p>
<button class="primary" type="submit" form="ott-form">Send Token</button>
</form>