[🐴] delete chat service account on account delete (#4056)
* delete chat service account on account delete * Add proxy header --------- Co-authored-by: Eric Bailey <git@esb.lol>zio/stable
parent
f42f7fa035
commit
cef243bcf4
|
@ -11,6 +11,7 @@ import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
import {useModalControls} from '#/state/modals'
|
import {useModalControls} from '#/state/modals'
|
||||||
|
import {DM_SERVICE_HEADERS} from '#/state/queries/messages/const'
|
||||||
import {useAgent, useSession, useSessionApi} from '#/state/session'
|
import {useAgent, useSession, useSessionApi} from '#/state/session'
|
||||||
import {usePalette} from 'lib/hooks/usePalette'
|
import {usePalette} from 'lib/hooks/usePalette'
|
||||||
import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
|
import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
|
||||||
|
@ -61,6 +62,16 @@ export function Component({}: {}) {
|
||||||
const token = confirmCode.replace(/\s/g, '')
|
const token = confirmCode.replace(/\s/g, '')
|
||||||
|
|
||||||
try {
|
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({
|
await getAgent().com.atproto.server.deleteAccount({
|
||||||
did: currentAccount.did,
|
did: currentAccount.did,
|
||||||
password,
|
password,
|
||||||
|
|
Loading…
Reference in New Issue