File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6060 <h2 class =" login-form__headline" data-login-form-headline v-html =" headline" />
6161 <NcTextField id =" user"
6262 ref =" user"
63- :label =" t('core', 'Login or email') "
63+ :label =" loginText "
6464 name =" user"
6565 :value.sync =" user"
6666 :class =" {shake: invalidPassword}"
@@ -156,6 +156,12 @@ export default {
156156 type: Boolean ,
157157 default: false ,
158158 },
159+ emailStates: {
160+ type: Array ,
161+ default () {
162+ return []
163+ }
164+ },
159165 },
160166
161167 data () {
@@ -207,6 +213,15 @@ export default {
207213 loginActionUrl () {
208214 return generateUrl (' login' )
209215 },
216+ emailEnabled () {
217+ return this .emailStates ? this .emailStates .every ((state ) => state === ' 1' ) : 1
218+ },
219+ loginText () {
220+ if (this .emailEnabled ) {
221+ return t (' core' , ' Login with username or email' )
222+ }
223+ return t (' core' , ' Login with username' )
224+ },
210225 },
211226
212227 mounted () {
Original file line number Diff line number Diff line change 3232 :errors =" errors"
3333 :throttle-delay =" throttleDelay"
3434 :auto-complete-allowed =" autoCompleteAllowed"
35+ :email-states =" emailStates"
3536 @submit =" loading = true" />
3637 <a v-if =" canResetPassword && resetPasswordLink !== ''"
3738 id =" lost-password"
@@ -179,6 +180,7 @@ export default {
179180 isLocalhost: window .location .hostname === ' localhost' ,
180181 hasPublicKeyCredential: typeof (window .PublicKeyCredential ) !== ' undefined' ,
181182 hideLoginForm: loadState (' core' , ' hideLoginForm' , false ),
183+ emailStates: loadState (' core' , ' emailStates' , []),
182184 }
183185 },
184186
You can’t perform that action at this time.
0 commit comments