Skip to content

Commit

Permalink
[🐴] delete chat service account on account delete (#4056)
Browse files Browse the repository at this point in the history
* delete chat service account on account delete

* Add proxy header

---------

Co-authored-by: Eric Bailey <[email protected]>
  • Loading branch information
mozzius and estrattonbailey authored May 17, 2024
1 parent f42f7fa commit cef243b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/view/com/modals/DeleteAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'

import {useModalControls} from '#/state/modals'
import {DM_SERVICE_HEADERS} from '#/state/queries/messages/const'
import {useAgent, useSession, useSessionApi} from '#/state/session'
import {usePalette} from 'lib/hooks/usePalette'
import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
Expand Down Expand Up @@ -61,6 +62,16 @@ export function Component({}: {}) {
const token = confirmCode.replace(/\s/g, '')

try {
// inform chat service of intent to delete account
const {success} = await getAgent().api.chat.bsky.actor.deleteAccount(
undefined,
{
headers: DM_SERVICE_HEADERS,
},
)
if (!success) {
throw new Error('Failed to inform chat service of account deletion')
}
await getAgent().com.atproto.server.deleteAccount({
did: currentAccount.did,
password,
Expand Down

0 comments on commit cef243b

Please sign in to comment.