sysauth: add autocomplete and id attributes to login inputs
authorViktor Tsvetkov <zwetvik@gmail.com>
Fri, 24 Dec 2021 11:36:35 +0000 (12:36 +0100)
committerJo-Philipp Wich <jo@mein.io>
Sat, 15 Oct 2022 12:31:47 +0000 (14:31 +0200)
this let browser automatically fill according to HTML spec for input elements.
luci-theme-bootstrap and luci-base are affected.

Signed-off-by: Viktor Tsvetkov <zwetvik@gmail.com>
[indentation fix]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/luasrc/view/sysauth.htm
themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/sysauth.htm

index acd5ff7e38f9c3c407958a3249c85ffa61115e37..797c87a72ee4ffdd52d7e6ac9eefff396a75e5af 100644 (file)
                </div>
                <div class="cbi-section"><div class="cbi-section-node">
                        <div class="cbi-value">
-                               <label class="cbi-value-title"><%:Username%></label>
+                               <label class="cbi-value-title" for="luci_username"><%:Username%></label>
                                <div class="cbi-value-field">
-                                       <input class="cbi-input-text" type="text" name="luci_username" value="<%=duser%>" />
+                                       <input class="cbi-input-text" type="text" name="luci_username" id="luci_username" autocomplete="username" value="<%=duser%>" />
                                </div>
                        </div>
                        <div class="cbi-value cbi-value-last">
-                               <label class="cbi-value-title"><%:Password%></label>
+                               <label class="cbi-value-title" for="luci_password"><%:Password%></label>
                                <div class="cbi-value-field">
-                                       <input class="cbi-input-text" type="password" name="luci_password" />
+                                       <input class="cbi-input-text" type="password" name="luci_password" id="luci_password" autocomplete="current-password"/>
                                </div>
                        </div>
                </div></div>
index 8a97bbd104d87cf0c53d08c0abb8a7b41e01d3a9..72b04783bbf9ccb46c5be9b2f92488b0709dc0e7 100644 (file)
                                <div class="cbi-value">
                                        <label class="cbi-value-title" for="luci_username"><%:Username%></label>
                                        <div class="cbi-value-field">
-                                               <input name="luci_username" type="text"<%=attr("value", duser)%>>
+                                               <input name="luci_username" id="luci_username" type="text" autocomplete="username" <%=attr("value", duser)%>>
                                        </div>
                                </div>
                                <div class="cbi-value">
                                        <label class="cbi-value-title" for="luci_password"><%:Password%></label>
                                        <div class="cbi-value-field">
-                                               <input name="luci_password" type="password">
+                                               <input name="luci_password" id="luci_password" type="password" autocomplete="current-password">
                                        </div>
                                </div>
                        </div>