Added autocomplete attributes for login fields

This commit is contained in:
neviyn 2021-05-10 23:08:00 +01:00
parent 20b9dcf1d5
commit 0ea4b27c94
3 changed files with 10 additions and 10 deletions

View File

@ -38,19 +38,19 @@
<div class="form-group d-flex flex-row align-items-center"> <div class="form-group d-flex flex-row align-items-center">
<input id="redirectURL" name="redirect" type="hidden" value=""> <input id="redirectURL" name="redirect" type="hidden" value="">
<!--suppress HtmlFormInputWithoutLabel --> <!--suppress HtmlFormInputWithoutLabel -->
<input class="form-control form-control-sm" id="username" name="username" placeholder="Username" type="text"> <input class="form-control form-control-sm" id="username" name="username" placeholder="Username" type="text" autocomplete="username">
<!--suppress HtmlFormInputWithoutLabel --> <!--suppress HtmlFormInputWithoutLabel -->
<input class="form-control form-control-sm" id="password" name="password" placeholder="Password" type="password"> <input class="form-control form-control-sm" id="password" name="password" placeholder="Password" type="password" autocomplete="current-password">
<input name="${_csrf.parameterName}" type="hidden" value="${_csrf.token}"/> <input name="${_csrf.parameterName}" type="hidden" value="${_csrf.token}"/>
<button class="btn btn-primary btn-sm text-nowrap" type="submit">Log In</button> <button class="btn btn-primary btn-sm text-nowrap" type="submit">Log In</button>
</div> </div>
</form>
</div>
</div>
<script> <script>
// Set logging in via this page to redirect back to this exact page // Set logging in via this page to redirect back to this exact page
document.getElementById('redirectURL').setAttribute('value', window.location.href) document.getElementById('redirectURL').setAttribute('value', window.location.href)
</script> </script>
</form>
</div>
</div>
</nav> </nav>
</div> </div>
<div th:fragment="searchBarRow"> <div th:fragment="searchBarRow">

View File

@ -19,11 +19,11 @@
<input name="redirect" th:value="${redirect}" type="hidden"> <input name="redirect" th:value="${redirect}" type="hidden">
<span th:text="${message}"></span> <span th:text="${message}"></span>
<div class="form-floating mb-3"> <div class="form-floating mb-3">
<input autofocus class="form-control form-control-lg" id="username" name="username" type="text"> <input autofocus class="form-control form-control-lg" id="username" name="username" type="text" autocomplete="username">
<label for="username">Username</label> <label for="username">Username</label>
</div> </div>
<div class="form-floating mb-3"> <div class="form-floating mb-3">
<input class="form-control form-control-lg" id="password" name="password" type="password"> <input class="form-control form-control-lg" id="password" name="password" type="password" autocomplete="current-password">
<label for="password">Password</label> <label for="password">Password</label>
</div> </div>
<div class="mb-3"> <div class="mb-3">

View File

@ -26,13 +26,13 @@
</div> </div>
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-text">Password</span> <span class="input-group-text">Password</span>
<input aria-label="Password" class="form-control" th:field="*{password}" type="password"> <input aria-label="Password" class="form-control" th:field="*{password}" type="password" autocomplete="new-password">
</div> </div>
<p>Please enter your existing password to update your profile.</p> <p>Please enter your existing password to update your profile.</p>
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-text">Existing Password</span> <span class="input-group-text">Existing Password</span>
<input aria-label="Existing Password" class="form-control form-control-lg" th:field="*{oldPassword}" <input aria-label="Existing Password" class="form-control form-control-lg" th:field="*{oldPassword}"
type="password"> type="password" autocomplete="current-password">
</div> </div>
</div> </div>
</div> </div>