5151 <h2 class =" login-form__headline" data-login-form-headline >
5252 {{ headlineText }}
5353 </h2 >
54- <NcTextField
54+ <LoginNameInput
5555 id="user"
5656 ref="user"
57- v-model =" user "
58- :label =" loginText "
59- name="user"
60- :maxlength =" 255 "
57+ :user .sync =" user "
6158 :class =" { shake: invalidPassword } "
62- autocapitalize="none "
63- :spellchecking = " false "
64- : autocomplete = " autoCompleteAllowed ? ' username ' : ' off ' "
59+ : auto-complete-allowed = " autoCompleteAllowed "
60+ :allow-email = " emailEnabled "
61+ name="user "
6562 required
66- :error =" userNameInputLengthIs255 "
67- :helper-text =" userInputHelperText "
68- data-login-form-input-user
69- @change =" updateUsername " />
63+ data-login-form-input-user />
7064
7165 <NcPasswordField
7266 id="password"
@@ -131,23 +125,20 @@ import debounce from 'debounce'
131125import NcCheckboxRadioSwitch from ' @nextcloud/vue/components/NcCheckboxRadioSwitch'
132126import NcNoteCard from ' @nextcloud/vue/components/NcNoteCard'
133127import NcPasswordField from ' @nextcloud/vue/components/NcPasswordField'
134- import NcTextField from ' @nextcloud/vue/components/NcTextField'
135128import LoginButton from ' ./LoginButton.vue'
136- import AuthMixin from ' ../../mixins/auth.js '
129+ import LoginNameInput from ' ./LoginNameInput.vue '
137130
138131export default {
139132 name: ' LoginForm' ,
140133
141134 components: {
142135 LoginButton,
136+ LoginNameInput,
143137 NcCheckboxRadioSwitch,
144138 NcPasswordField,
145- NcTextField,
146139 NcNoteCard,
147140 },
148141
149- mixins: [AuthMixin],
150-
151142 props: {
152143 username: {
153144 type: String ,
@@ -285,13 +276,6 @@ export default {
285276 emailEnabled () {
286277 return this .emailStates .every ((state ) => state === ' 1' )
287278 },
288-
289- loginText () {
290- if (this .emailEnabled ) {
291- return t (' core' , ' Account name or email' )
292- }
293- return t (' core' , ' Account name' )
294- },
295279 },
296280
297281 watch: {
@@ -305,9 +289,9 @@ export default {
305289
306290 mounted () {
307291 if (this .username === ' ' ) {
308- this .$refs .user .$refs . inputField . $refs . input . focus ()
292+ this .$refs .user .focus ()
309293 } else {
310- this .$refs .password .$refs . inputField . $refs . input . focus ()
294+ this .$refs .password .focus ()
311295 }
312296 },
313297
0 commit comments