Files
ToBePlayed-Frontend/src/utils/account.js
T
lobo 46587dfb5c
Build, Test & Push Frontend / quality-check (push) Successful in 16s
Build, Test & Push Frontend / docker (push) Successful in 26s
feat(settings): let users delete their account
2026-09-27 11:46:22 +02:00

12 lines
392 B
JavaScript

import {apiFetch} from './api.js';
/**
* DELETE /api/users/me on Auth: 204 (cookies cleared), 403 INVALID_PASSWORD, 429 with Retry-After in seconds.
*/
export const deleteAccount = (password) =>
apiFetch(`${import.meta.env.VITE_API_URL}/api/users/me`, {
method: 'DELETE',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({password}),
});