Bläddra i källkod

better autocomplete for password and token inputs (#2505)

Rizvan Nukhtarov 3 veckor sedan
förälder
incheckning
5d7de0858c
2 ändrade filer med 8 tillägg och 6 borttagningar
  1. 3 3
      web/html/login.html
  2. 5 3
      web/html/xui/component/password.html

+ 3 - 3
web/html/login.html

@@ -416,19 +416,19 @@
               <a-col span="24">
                 <a-form>
                   <a-form-item>
-                    <a-input autocomplete="username" v-model.trim="user.username" placeholder='{{ i18n "username" }}'
+                    <a-input autocomplete="username" name="username" v-model.trim="user.username" placeholder='{{ i18n "username" }}'
                              @keydown.enter.native="login" autofocus>
                       <a-icon slot="prefix" type="user" style="font-size: 16px;"></a-icon>
                     </a-input>
                   </a-form-item>
                   <a-form-item>
-                    <password-input autocomplete="current-password" icon="lock" v-model.trim="user.password"
+                    <password-input autocomplete="password" name="password" icon="lock" v-model.trim="user.password"
                                     placeholder='{{ i18n "password" }}'
                                     @keydown.enter.native="login">
                     </password-input>
                   </a-form-item>
                   <a-form-item v-if="secretEnable">
-                    <password-input autocomplete="secret" icon="key" v-model.trim="user.loginSecret"
+                    <password-input autocomplete="secret" name="secret" icon="key" v-model.trim="user.loginSecret"
                                     placeholder='{{ i18n "secretToken" }}'
                                     @keydown.enter.native="login">
                     </password-input>

+ 5 - 3
web/html/xui/component/password.html

@@ -1,8 +1,10 @@
 {{define "component/passwordInput"}}
 <template>
     <a-input :value="value" :type="showPassword ? 'text' : 'password'"
-            :placeholder="placeholder"
-            @input="$emit('input', $event.target.value)">
+             :placeholder="placeholder"
+             :autocomplete="autocomplete"
+             :name="name"
+             @input="$emit('input', $event.target.value)">
         <template v-if="icon" #prefix>
             <a-icon :type="icon" style="font-size: 16px;" />
         </template>
@@ -18,7 +20,7 @@
 {{define "component/password"}}
 <script>
   Vue.component('password-input', {
-    props: ["title", "value", "placeholder", "icon"],
+    props: ["title", "value", "placeholder", "icon", "autocomplete", "name"],
     template: `{{template "component/passwordInput"}}`,
     data() {
       return {