mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-27 09:45:13 +00:00
[Auth] Allow change password in user panel (#3699)
Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import PromptDialogContent from '@/components/dialog/content/PromptDialogContent
|
||||
import SettingDialogContent from '@/components/dialog/content/SettingDialogContent.vue'
|
||||
import SignInContent from '@/components/dialog/content/SignInContent.vue'
|
||||
import TopUpCreditsDialogContent from '@/components/dialog/content/TopUpCreditsDialogContent.vue'
|
||||
import UpdatePasswordContent from '@/components/dialog/content/UpdatePasswordContent.vue'
|
||||
import ManagerDialogContent from '@/components/dialog/content/manager/ManagerDialogContent.vue'
|
||||
import ManagerHeader from '@/components/dialog/content/manager/ManagerHeader.vue'
|
||||
import ManagerProgressFooter from '@/components/dialog/footer/ManagerProgressFooter.vue'
|
||||
@@ -363,6 +364,21 @@ export const useDialogService = () => {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows a dialog for updating the current user's password.
|
||||
*/
|
||||
function showUpdatePasswordDialog() {
|
||||
return dialogStore.showDialog({
|
||||
key: 'global-update-password',
|
||||
component: UpdatePasswordContent,
|
||||
headerComponent: ComfyOrgHeader,
|
||||
props: {
|
||||
onSuccess: () =>
|
||||
dialogStore.closeDialog({ key: 'global-update-password' })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
showLoadWorkflowWarning,
|
||||
showMissingModelsWarning,
|
||||
@@ -377,6 +393,7 @@ export const useDialogService = () => {
|
||||
showApiNodesSignInDialog,
|
||||
showSignInDialog,
|
||||
showTopUpCreditsDialog,
|
||||
showUpdatePasswordDialog,
|
||||
prompt,
|
||||
confirm
|
||||
}
|
||||
|
||||
@@ -118,6 +118,19 @@ export const useFirebaseAuthService = () => {
|
||||
reportError
|
||||
)
|
||||
|
||||
const updatePassword = wrapWithErrorHandlingAsync(
|
||||
async (newPassword: string) => {
|
||||
await authStore.updatePassword(newPassword)
|
||||
toastStore.add({
|
||||
severity: 'success',
|
||||
summary: t('auth.passwordUpdate.success'),
|
||||
detail: t('auth.passwordUpdate.successDetail'),
|
||||
life: 5000
|
||||
})
|
||||
},
|
||||
reportError
|
||||
)
|
||||
|
||||
return {
|
||||
logout,
|
||||
sendPasswordReset,
|
||||
@@ -127,6 +140,7 @@ export const useFirebaseAuthService = () => {
|
||||
signInWithGoogle,
|
||||
signInWithGithub,
|
||||
signInWithEmail,
|
||||
signUpWithEmail
|
||||
signUpWithEmail,
|
||||
updatePassword
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user