mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 19:21:54 +00:00
fix: remove delete account button and direct users to support (#8515)
## Summary Reverts PR #5216 delete account functionality. The delete button only removed Firebase accounts without canceling Stripe subscriptions, causing orphaned accounts and support issues. ## Changes - Removed delete account button from UserPanel.vue - Added text directing users to contact support@comfy.org for account deletion (clickable mailto: link) - Cleaned up related code: removed `handleDeleteAccount` from useCurrentUser.ts, `deleteAccount` from useFirebaseAuthActions.ts, `_deleteAccount` from firebaseAuthStore.ts - Updated en/main.json locale with `contactSupport` key using {email} placeholder ## Testing - Typecheck and lint pass - Manual verification: user settings panel shows contact support text instead of delete button ## Related Issues Fixes COM-14243 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8515-fix-remove-delete-account-button-and-direct-users-to-support-2fa6d73d3650819dbc83efb41c07a809) by [Unito](https://www.unito.io) Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -63,14 +63,18 @@
|
|||||||
<i class="pi pi-sign-out" />
|
<i class="pi pi-sign-out" />
|
||||||
{{ $t('auth.signOut.signOut') }}
|
{{ $t('auth.signOut.signOut') }}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<i18n-t
|
||||||
v-if="!isApiKeyLogin"
|
v-if="!isApiKeyLogin"
|
||||||
class="w-fit"
|
keypath="auth.deleteAccount.contactSupport"
|
||||||
variant="destructive-textonly"
|
tag="p"
|
||||||
@click="handleDeleteAccount"
|
class="text-muted text-sm"
|
||||||
>
|
>
|
||||||
{{ $t('auth.deleteAccount.deleteAccount') }}
|
<template #email>
|
||||||
</Button>
|
<a href="mailto:support@comfy.org" class="underline"
|
||||||
|
>support@comfy.org</a
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</i18n-t>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -116,7 +120,6 @@ const {
|
|||||||
providerName,
|
providerName,
|
||||||
providerIcon,
|
providerIcon,
|
||||||
handleSignOut,
|
handleSignOut,
|
||||||
handleSignIn,
|
handleSignIn
|
||||||
handleDeleteAccount
|
|
||||||
} = useCurrentUser()
|
} = useCurrentUser()
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
import { whenever } from '@vueuse/core'
|
import { whenever } from '@vueuse/core'
|
||||||
import { computed, watch } from 'vue'
|
import { computed, watch } from 'vue'
|
||||||
|
|
||||||
import { useFirebaseAuthActions } from '@/composables/auth/useFirebaseAuthActions'
|
|
||||||
import { t } from '@/i18n'
|
|
||||||
import { useDialogService } from '@/services/dialogService'
|
|
||||||
import { useApiKeyAuthStore } from '@/stores/apiKeyAuthStore'
|
import { useApiKeyAuthStore } from '@/stores/apiKeyAuthStore'
|
||||||
import { useCommandStore } from '@/stores/commandStore'
|
import { useCommandStore } from '@/stores/commandStore'
|
||||||
import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore'
|
import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore'
|
||||||
@@ -13,8 +10,6 @@ export const useCurrentUser = () => {
|
|||||||
const authStore = useFirebaseAuthStore()
|
const authStore = useFirebaseAuthStore()
|
||||||
const commandStore = useCommandStore()
|
const commandStore = useCommandStore()
|
||||||
const apiKeyStore = useApiKeyAuthStore()
|
const apiKeyStore = useApiKeyAuthStore()
|
||||||
const dialogService = useDialogService()
|
|
||||||
const { deleteAccount } = useFirebaseAuthActions()
|
|
||||||
|
|
||||||
const firebaseUser = computed(() => authStore.currentUser)
|
const firebaseUser = computed(() => authStore.currentUser)
|
||||||
const isApiKeyLogin = computed(() => apiKeyStore.isAuthenticated)
|
const isApiKeyLogin = computed(() => apiKeyStore.isAuthenticated)
|
||||||
@@ -116,18 +111,6 @@ export const useCurrentUser = () => {
|
|||||||
await commandStore.execute('Comfy.User.OpenSignInDialog')
|
await commandStore.execute('Comfy.User.OpenSignInDialog')
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleDeleteAccount = async () => {
|
|
||||||
const confirmed = await dialogService.confirm({
|
|
||||||
title: t('auth.deleteAccount.confirmTitle'),
|
|
||||||
message: t('auth.deleteAccount.confirmMessage'),
|
|
||||||
type: 'delete'
|
|
||||||
})
|
|
||||||
|
|
||||||
if (confirmed) {
|
|
||||||
await deleteAccount()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
loading: authStore.loading,
|
loading: authStore.loading,
|
||||||
isLoggedIn,
|
isLoggedIn,
|
||||||
@@ -141,7 +124,6 @@ export const useCurrentUser = () => {
|
|||||||
resolvedUserInfo,
|
resolvedUserInfo,
|
||||||
handleSignOut,
|
handleSignOut,
|
||||||
handleSignIn,
|
handleSignIn,
|
||||||
handleDeleteAccount,
|
|
||||||
onUserResolved,
|
onUserResolved,
|
||||||
onTokenRefreshed,
|
onTokenRefreshed,
|
||||||
onUserLogout
|
onUserLogout
|
||||||
|
|||||||
@@ -206,21 +206,6 @@ export const useFirebaseAuthActions = () => {
|
|||||||
[createReauthenticationRecovery<[string], void>()]
|
[createReauthenticationRecovery<[string], void>()]
|
||||||
)
|
)
|
||||||
|
|
||||||
const deleteAccount = wrapWithErrorHandlingAsync(
|
|
||||||
async () => {
|
|
||||||
await authStore.deleteAccount()
|
|
||||||
toastStore.add({
|
|
||||||
severity: 'success',
|
|
||||||
summary: t('auth.deleteAccount.success'),
|
|
||||||
detail: t('auth.deleteAccount.successDetail'),
|
|
||||||
life: 5000
|
|
||||||
})
|
|
||||||
},
|
|
||||||
reportError,
|
|
||||||
undefined,
|
|
||||||
[createReauthenticationRecovery<[], void>()]
|
|
||||||
)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
logout,
|
logout,
|
||||||
sendPasswordReset,
|
sendPasswordReset,
|
||||||
@@ -232,7 +217,6 @@ export const useFirebaseAuthActions = () => {
|
|||||||
signInWithEmail,
|
signInWithEmail,
|
||||||
signUpWithEmail,
|
signUpWithEmail,
|
||||||
updatePassword,
|
updatePassword,
|
||||||
deleteAccount,
|
|
||||||
accessError,
|
accessError,
|
||||||
reportError
|
reportError
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1949,13 +1949,7 @@
|
|||||||
"auth/cancelled-popup-request": "Sign-in was cancelled. Please try again."
|
"auth/cancelled-popup-request": "Sign-in was cancelled. Please try again."
|
||||||
},
|
},
|
||||||
"deleteAccount": {
|
"deleteAccount": {
|
||||||
"deleteAccount": "Delete Account",
|
"contactSupport": "To delete your account, please contact {email}"
|
||||||
"confirmTitle": "Delete Account",
|
|
||||||
"confirmMessage": "Are you sure you want to delete your account? This action cannot be undone and will permanently remove all your data.",
|
|
||||||
"confirm": "Delete Account",
|
|
||||||
"cancel": "Cancel",
|
|
||||||
"success": "Account Deleted",
|
|
||||||
"successDetail": "Your account has been successfully deleted."
|
|
||||||
},
|
},
|
||||||
"reauthRequired": {
|
"reauthRequired": {
|
||||||
"title": "Re-authentication Required",
|
"title": "Re-authentication Required",
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import {
|
|||||||
GoogleAuthProvider,
|
GoogleAuthProvider,
|
||||||
browserLocalPersistence,
|
browserLocalPersistence,
|
||||||
createUserWithEmailAndPassword,
|
createUserWithEmailAndPassword,
|
||||||
deleteUser,
|
|
||||||
getAdditionalUserInfo,
|
getAdditionalUserInfo,
|
||||||
onAuthStateChanged,
|
onAuthStateChanged,
|
||||||
onIdTokenChanged,
|
onIdTokenChanged,
|
||||||
@@ -429,14 +428,6 @@ export const useFirebaseAuthStore = defineStore('firebaseAuth', () => {
|
|||||||
await updatePassword(currentUser.value, newPassword)
|
await updatePassword(currentUser.value, newPassword)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Delete the current user account */
|
|
||||||
const _deleteAccount = async (): Promise<void> => {
|
|
||||||
if (!currentUser.value) {
|
|
||||||
throw new FirebaseAuthStoreError(t('toastMessages.userNotAuthenticated'))
|
|
||||||
}
|
|
||||||
await deleteUser(currentUser.value)
|
|
||||||
}
|
|
||||||
|
|
||||||
const addCredits = async (
|
const addCredits = async (
|
||||||
requestBodyContent: CreditPurchasePayload
|
requestBodyContent: CreditPurchasePayload
|
||||||
): Promise<CreditPurchaseResponse> => {
|
): Promise<CreditPurchaseResponse> => {
|
||||||
@@ -536,7 +527,6 @@ export const useFirebaseAuthStore = defineStore('firebaseAuth', () => {
|
|||||||
accessBillingPortal,
|
accessBillingPortal,
|
||||||
sendPasswordReset,
|
sendPasswordReset,
|
||||||
updatePassword: _updatePassword,
|
updatePassword: _updatePassword,
|
||||||
deleteAccount: _deleteAccount,
|
|
||||||
getAuthHeader,
|
getAuthHeader,
|
||||||
getFirebaseAuthHeader,
|
getFirebaseAuthHeader,
|
||||||
getAuthToken
|
getAuthToken
|
||||||
|
|||||||
Reference in New Issue
Block a user