[Auth] Allow change password in user panel (#3699)

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2025-04-30 16:12:57 -04:00
committed by GitHub
parent a43d1e1ee8
commit 834d5820d2
15 changed files with 305 additions and 169 deletions

View File

@@ -38,6 +38,17 @@
<div class="text-muted flex items-center gap-1">
<i :class="providerIcon" />
{{ providerName }}
<Button
v-if="isEmailProvider"
v-tooltip="{
value: $t('userSettings.updatePassword'),
showDelay: 300
}"
icon="pi pi-pen-to-square"
severity="secondary"
text
@click="dialogService.showUpdatePasswordDialog()"
/>
</div>
</div>
@@ -83,9 +94,11 @@ import ProgressSpinner from 'primevue/progressspinner'
import TabPanel from 'primevue/tabpanel'
import { computed } from 'vue'
import { useDialogService } from '@/services/dialogService'
import { useCommandStore } from '@/stores/commandStore'
import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore'
const dialogService = useDialogService()
const authStore = useFirebaseAuthStore()
const commandStore = useCommandStore()
const user = computed(() => authStore.currentUser)
@@ -113,6 +126,11 @@ const providerIcon = computed(() => {
return 'pi pi-user'
})
const isEmailProvider = computed(() => {
const providerId = user.value?.providerData[0]?.providerId
return providerId === 'password'
})
const handleSignOut = async () => {
await commandStore.execute('Comfy.User.SignOut')
}