Skip to content

Commit

Permalink
Fix:Hide change password form when password auth is disabled #2367
Browse files Browse the repository at this point in the history
  • Loading branch information
advplyr committed Dec 1, 2023
1 parent 6ab966e commit f59516c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions client/pages/account.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

<div class="w-full h-px bg-white/10 my-4" />

<p v-if="!isGuest" class="mb-4 text-lg">{{ $strings.HeaderChangePassword }}</p>
<form v-if="!isGuest" @submit.prevent="submitChangePassword">
<p v-if="showChangePasswordForm" class="mb-4 text-lg">{{ $strings.HeaderChangePassword }}</p>
<form v-if="showChangePasswordForm" @submit.prevent="submitChangePassword">
<ui-text-input-with-label v-model="password" :disabled="changingPassword" type="password" :label="$strings.LabelPassword" class="my-2" />
<ui-text-input-with-label v-model="newPassword" :disabled="changingPassword" type="password" :label="$strings.LabelNewPassword" class="my-2" />
<ui-text-input-with-label v-model="confirmPassword" :disabled="changingPassword" type="password" :label="$strings.LabelConfirmPassword" class="my-2" />
Expand Down Expand Up @@ -68,6 +68,13 @@ export default {
},
isGuest() {
return this.usertype === 'guest'
},
isPasswordAuthEnabled() {
const activeAuthMethods = this.$store.getters['getServerSetting']('authActiveAuthMethods') || []
return activeAuthMethods.includes('local')
},
showChangePasswordForm() {
return !this.isGuest && this.isPasswordAuthEnabled
}
},
methods: {
Expand Down

0 comments on commit f59516c

Please sign in to comment.