Skip to content

Commit

Permalink
fix: login page now correctly shows email LDAP settings
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Morales <emoral435@gmail.com>
  • Loading branch information
emoral435 committed Mar 11, 2024
1 parent 0045eec commit 8db750f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions core/src/components/login/LoginForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ export default {
type: Boolean,
default: false,
},
emailStates: {
type: Array,
default() {
return []
}
},
},
data() {
Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 2 additions & 0 deletions core/src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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', []),
}
},
Expand Down

0 comments on commit 8db750f

Please sign in to comment.