From 834d5820d2e0b5b4146d26e7f40dcdc894a50c6a Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Wed, 30 Apr 2025 16:12:57 -0400 Subject: [PATCH] [Auth] Allow change password in user panel (#3699) Co-authored-by: github-actions --- .../dialog/content/UpdatePasswordContent.vue | 47 ++++++ .../dialog/content/setting/UserPanel.vue | 18 +++ .../dialog/content/signin/PasswordFields.vue | 111 ++++++++++++++ .../dialog/content/signin/SignUpForm.vue | 139 +++--------------- src/locales/en/main.json | 11 +- src/locales/es/main.json | 11 +- src/locales/fr/main.json | 11 +- src/locales/ja/main.json | 11 +- src/locales/ko/main.json | 11 +- src/locales/ru/main.json | 11 +- src/locales/zh/main.json | 11 +- src/schemas/signInSchema.ts | 35 +++-- src/services/dialogService.ts | 17 +++ src/services/firebaseAuthService.ts | 16 +- src/stores/firebaseAuthStore.ts | 14 +- 15 files changed, 305 insertions(+), 169 deletions(-) create mode 100644 src/components/dialog/content/UpdatePasswordContent.vue create mode 100644 src/components/dialog/content/signin/PasswordFields.vue diff --git a/src/components/dialog/content/UpdatePasswordContent.vue b/src/components/dialog/content/UpdatePasswordContent.vue new file mode 100644 index 0000000000..470a567258 --- /dev/null +++ b/src/components/dialog/content/UpdatePasswordContent.vue @@ -0,0 +1,47 @@ + + + diff --git a/src/components/dialog/content/setting/UserPanel.vue b/src/components/dialog/content/setting/UserPanel.vue index 82c5ae0fa0..2529261d7a 100644 --- a/src/components/dialog/content/setting/UserPanel.vue +++ b/src/components/dialog/content/setting/UserPanel.vue @@ -38,6 +38,17 @@
{{ providerName }} +
@@ -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') } diff --git a/src/components/dialog/content/signin/PasswordFields.vue b/src/components/dialog/content/signin/PasswordFields.vue new file mode 100644 index 0000000000..8429904fd1 --- /dev/null +++ b/src/components/dialog/content/signin/PasswordFields.vue @@ -0,0 +1,111 @@ + + + diff --git a/src/components/dialog/content/signin/SignUpForm.vue b/src/components/dialog/content/signin/SignUpForm.vue index 64280346df..027a6059fc 100644 --- a/src/components/dialog/content/signin/SignUpForm.vue +++ b/src/components/dialog/content/signin/SignUpForm.vue @@ -1,12 +1,11 @@