mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-07-30 17:59:13 -04:00
19 lines
518 B
TypeScript
19 lines
518 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()
|
|
}
|