Skip to content

Commit 500ecfd

Browse files
committed
fix: login page now correctly shows email LDAP settings
Signed-off-by: Eduardo Morales <emoral435@gmail.com>
1 parent 974a7d9 commit 500ecfd

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

core/src/components/login/LoginForm.vue

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
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() {

core/src/views/Login.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
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

0 commit comments

Comments
 (0)