fix: login page now correctly shows email LDAP settings

Signed-off-by: Eduardo Morales <emoral435@gmail.com>
pull/43946/head
Eduardo Morales 2024-03-04 09:34:44 +07:00
parent 0de6cc7472
commit 182342decc
2 changed files with 18 additions and 1 deletions

@ -60,7 +60,7 @@
<h2 class="login-form__headline" data-login-form-headline v-html="headline" />
<NcTextField id="user"
ref="user"
:label="t('core', 'Login or email')"
:label="loginText"
name="user"
:value.sync="user"
:class="{shake: invalidPassword}"
@ -156,6 +156,12 @@ export default {
type: Boolean,
default: false,
},
emailStates: {
type: Array,
default() {
return []
}
},
},
data() {
@ -207,6 +213,15 @@ export default {
loginActionUrl() {
return generateUrl('login')
},
emailEnabled() {
return this.emailStates ? this.emailStates.every((state) => state === '1') : 1
},
loginText() {
if (this.emailEnabled) {
return t('core', 'Login with username or email')
}
return t('core', 'Login with username')
},
},
mounted() {

@ -32,6 +32,7 @@
:errors="errors"
:throttle-delay="throttleDelay"
:auto-complete-allowed="autoCompleteAllowed"
:email-states="emailStates"
@submit="loading = true" />
<a v-if="canResetPassword && resetPasswordLink !== ''"
id="lost-password"
@ -179,6 +180,7 @@ export default {
isLocalhost: window.location.hostname === 'localhost',
hasPublicKeyCredential: typeof (window.PublicKeyCredential) !== 'undefined',
hideLoginForm: loadState('core', 'hideLoginForm', false),
emailStates: loadState('core', 'emailStates', []),
}
},