mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-02-25 11:27:09 -05:00
16 lines
513 B
TypeScript
16 lines
513 B
TypeScript
import posthog from 'posthog-js'
|
|
import {clearUserCookie} from 'web/components/auth-context'
|
|
import {api} from 'web/lib/api'
|
|
import {firebaseLogout} from 'web/lib/firebase/users'
|
|
import {track} from 'web/lib/service/analytics'
|
|
|
|
export async function deleteAccount(reasons?: {reasonCategory?: string | null; reasonDetails?: string}) {
|
|
track('delete account')
|
|
await api('me/delete', reasons || {})
|
|
await firebaseLogout()
|
|
clearUserCookie()
|
|
localStorage.clear()
|
|
sessionStorage.clear()
|
|
posthog.reset()
|
|
}
|