feat: add autocomplete attributes to form inputs for better browser/password manager support
All checks were successful
continuous-integration/drone/push Build is passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nemunaire 2026-03-08 14:06:47 +07:00
commit 2e6227b36c
4 changed files with 9 additions and 9 deletions

View file

@ -6,10 +6,10 @@
{{if .error}}<div class="alert alert-error" role="alert">{{.error}}</div>{{end}}
<input type="hidden" name="csrf_token" value="{{ .csrf_token }}">
<div class="form-field">
<input name="login" required="" class="form-control" id="input_0" type="text" placeholder="Login" autofocus>
<input name="login" required="" class="form-control" id="input_0" type="text" placeholder="Login" autofocus autocomplete="username">
</div>
<div class="form-field input-group">
<input name="password" required="" class="form-control" id="input_1" type="password" placeholder="Current password">
<input name="password" required="" class="form-control" id="input_1" type="password" placeholder="Current password" autocomplete="current-password">
<button class="btn-toggle-password" type="button" onclick="var i=document.getElementById('input_1');i.type=i.type=='password'?'text':'password'">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
@ -18,7 +18,7 @@
</button>
</div>
<div class="form-field input-group">
<input name="newpassword" required="" class="form-control" id="input_2" type="password" placeholder="New password">
<input name="newpassword" required="" class="form-control" id="input_2" type="password" placeholder="New password" autocomplete="new-password">
<button class="btn-toggle-password" type="button" onclick="var i=document.getElementById('input_2');i.type=i.type=='password'?'text':'password'">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
@ -27,7 +27,7 @@
</button>
</div>
<div class="form-field input-group">
<input name="new2password" required="" class="form-control" id="input_3" type="password" placeholder="Retype new password">
<input name="new2password" required="" class="form-control" id="input_3" type="password" placeholder="Retype new password" autocomplete="new-password">
<button class="btn-toggle-password" type="button" onclick="var i=document.getElementById('input_3');i.type=i.type=='password'?'text':'password'">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>

View file

@ -5,10 +5,10 @@
<form method="post" action="login">
{{if .error}}<div class="alert alert-error" role="alert">{{.error}}</div>{{end}}
<div class="form-field">
<input name="login" required="" class="form-control" id="input_0" type="text" placeholder="Login" autofocus>
<input name="login" required="" class="form-control" id="input_0" type="text" placeholder="Login" autofocus autocomplete="username">
</div>
<div class="form-field">
<input name="password" required="" class="form-control" id="input_1" type="password" placeholder="Current password">
<input name="password" required="" class="form-control" id="input_1" type="password" placeholder="Current password" autocomplete="current-password">
</div>
<div class="form-field">
<altcha-widget challengeurl="altcha-challenge"></altcha-widget>

View file

@ -6,7 +6,7 @@
{{if .error}}<div class="alert alert-error" role="alert">{{.error}}</div>{{end}}
<input type="hidden" name="csrf_token" value="{{ .csrf_token }}">
<div class="form-field">
<input name="login" required="" class="form-control" id="input_0" type="text" placeholder="Login" autofocus>
<input name="login" required="" class="form-control" id="input_0" type="text" placeholder="Login" autofocus autocomplete="username">
</div>
<div class="form-field">
<altcha-widget challengeurl="altcha-challenge"></altcha-widget>

View file

@ -11,10 +11,10 @@
<input type="hidden" name="login" value="{{ .login }}">
<input type="hidden" name="token" value="{{ .token }}">
<div class="form-field">
<input autofocus name="newpassword" required="" class="form-control" id="input_2" type="password" placeholder="New password">
<input autofocus name="newpassword" required="" class="form-control" id="input_2" type="password" placeholder="New password" autocomplete="new-password">
</div>
<div class="form-field">
<input name="new2password" required="" class="form-control" id="input_3" type="password" placeholder="Retype new password">
<input name="new2password" required="" class="form-control" id="input_3" type="password" placeholder="Retype new password" autocomplete="new-password">
</div>
<div class="form-field">
<altcha-widget challengeurl="altcha-challenge"></altcha-widget>