(reason: string)
| 224 | } |
| 225 | |
| 226 | export async function logout(reason: string): Promise<void> { |
| 227 | const urlParams = reason ? `?${new URLSearchParams({ reason })}` : ''; |
| 228 | await fetch(`${apiUrl}/v1/users/logout${urlParams}`, { |
| 229 | method: 'POST', |
| 230 | credentials: 'include', |
| 231 | }); |
| 232 | } |
| 233 | |
| 234 | export async function deleteAccount(): Promise<void> { |
| 235 | const res = await fetch(`${apiUrl}/v1/users/me`, { |