diff --git a/src/components/dialog/content/setting/UserPanel.vue b/src/components/dialog/content/setting/UserPanel.vue index 60bc6dba3..82985641d 100644 --- a/src/components/dialog/content/setting/UserPanel.vue +++ b/src/components/dialog/content/setting/UserPanel.vue @@ -63,14 +63,18 @@ {{ $t('auth.signOut.signOut') }} - + + @@ -116,7 +120,6 @@ const { providerName, providerIcon, handleSignOut, - handleSignIn, - handleDeleteAccount + handleSignIn } = useCurrentUser() diff --git a/src/composables/auth/useCurrentUser.ts b/src/composables/auth/useCurrentUser.ts index b43191fbb..28a427749 100644 --- a/src/composables/auth/useCurrentUser.ts +++ b/src/composables/auth/useCurrentUser.ts @@ -1,9 +1,6 @@ import { whenever } from '@vueuse/core' 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 { useCommandStore } from '@/stores/commandStore' import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore' @@ -13,8 +10,6 @@ export const useCurrentUser = () => { const authStore = useFirebaseAuthStore() const commandStore = useCommandStore() const apiKeyStore = useApiKeyAuthStore() - const dialogService = useDialogService() - const { deleteAccount } = useFirebaseAuthActions() const firebaseUser = computed(() => authStore.currentUser) const isApiKeyLogin = computed(() => apiKeyStore.isAuthenticated) @@ -116,18 +111,6 @@ export const useCurrentUser = () => { 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 { loading: authStore.loading, isLoggedIn, @@ -141,7 +124,6 @@ export const useCurrentUser = () => { resolvedUserInfo, handleSignOut, handleSignIn, - handleDeleteAccount, onUserResolved, onTokenRefreshed, onUserLogout diff --git a/src/composables/auth/useFirebaseAuthActions.ts b/src/composables/auth/useFirebaseAuthActions.ts index 319dfa851..2d021d734 100644 --- a/src/composables/auth/useFirebaseAuthActions.ts +++ b/src/composables/auth/useFirebaseAuthActions.ts @@ -206,21 +206,6 @@ export const useFirebaseAuthActions = () => { [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 { logout, sendPasswordReset, @@ -232,7 +217,6 @@ export const useFirebaseAuthActions = () => { signInWithEmail, signUpWithEmail, updatePassword, - deleteAccount, accessError, reportError } diff --git a/src/locales/en/main.json b/src/locales/en/main.json index 89190dcfe..55d5eaf85 100644 --- a/src/locales/en/main.json +++ b/src/locales/en/main.json @@ -1923,13 +1923,7 @@ "auth/cancelled-popup-request": "Sign-in was cancelled. Please try again." }, "deleteAccount": { - "deleteAccount": "Delete Account", - "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." + "contactSupport": "To delete your account, please contact {email}" }, "reauthRequired": { "title": "Re-authentication Required", diff --git a/src/stores/firebaseAuthStore.ts b/src/stores/firebaseAuthStore.ts index 32ae22a9a..6b8d35453 100644 --- a/src/stores/firebaseAuthStore.ts +++ b/src/stores/firebaseAuthStore.ts @@ -5,7 +5,6 @@ import { GoogleAuthProvider, browserLocalPersistence, createUserWithEmailAndPassword, - deleteUser, getAdditionalUserInfo, onAuthStateChanged, onIdTokenChanged, @@ -429,14 +428,6 @@ export const useFirebaseAuthStore = defineStore('firebaseAuth', () => { await updatePassword(currentUser.value, newPassword) } - /** Delete the current user account */ - const _deleteAccount = async (): Promise => { - if (!currentUser.value) { - throw new FirebaseAuthStoreError(t('toastMessages.userNotAuthenticated')) - } - await deleteUser(currentUser.value) - } - const addCredits = async ( requestBodyContent: CreditPurchasePayload ): Promise => { @@ -536,7 +527,6 @@ export const useFirebaseAuthStore = defineStore('firebaseAuth', () => { accessBillingPortal, sendPasswordReset, updatePassword: _updatePassword, - deleteAccount: _deleteAccount, getAuthHeader, getFirebaseAuthHeader, getAuthToken