diff --git a/README.md b/README.md
index c1e6c6c..7318ebe 100644
--- a/README.md
+++ b/README.md
@@ -54,6 +54,8 @@ To Be Played is split into three repositories:
to Core once per page load (`POST /api/library/broken-images`, only with a session). Core repairs it at night;
a repaired cover comes back as `imageUrl`.
- German and English, dark mode, mobile layout, session-expired message instead of a silent logout.
+- **Delete my account** in the settings: a dialog asks for the own email and the password. Auth blocks the
+ account at once and removes it after 30 days; the page ends the session and goes to the landing page.
- **Build version** in the settings: commit and build time of Frontend, Auth and Core, each hash links to its
commit. CI passes them as Docker build args; a local build shows `dev`.
- **Installable** as an app on phone and desktop (web app manifest, no service worker, so no offline mode).
diff --git a/public/i18n/de.json b/public/i18n/de.json
index d37be52..1e18dae 100644
--- a/public/i18n/de.json
+++ b/public/i18n/de.json
@@ -106,7 +106,21 @@
"UNLINKED": "Steam-Verknüpfung gelöst."
},
"VERSION": "Version",
- "VERSION_UNKNOWN": "unbekannt"
+ "VERSION_UNKNOWN": "unbekannt",
+ "DELETE_ACCOUNT": {
+ "TITLE": "Konto löschen",
+ "EXPLAIN": "Dein Konto wird sofort gesperrt: kein Login, kein öffentliches Profil. Nach 30 Tagen wird es endgültig entfernt, mit Bibliothek, Backlog und Statistiken.",
+ "BUTTON": "Mein Konto löschen",
+ "DIALOG_TITLE": "Konto wirklich löschen?",
+ "TYPE_EMAIL": "Gib zur Bestätigung deine E-Mail ein",
+ "PASSWORD": "Passwort",
+ "CONFIRM": "Endgültig löschen",
+ "CANCEL": "Abbrechen",
+ "DONE": "Dein Konto ist gelöscht.",
+ "WRONG_PASSWORD": "Das Passwort ist falsch.",
+ "TOO_MANY": "Zu viele falsche Passwörter. Bitte in {{minutes}} Minuten erneut versuchen.",
+ "ERROR": "Das Konto konnte nicht gelöscht werden. Bitte später erneut versuchen."
+ }
},
"VALIDATION": {
"EMAIL_REQUIRED": "Email ist erforderlich.",
diff --git a/public/i18n/en.json b/public/i18n/en.json
index 5f6041e..d590705 100644
--- a/public/i18n/en.json
+++ b/public/i18n/en.json
@@ -106,7 +106,21 @@
"UNLINKED": "Steam account unlinked."
},
"VERSION": "Version",
- "VERSION_UNKNOWN": "unknown"
+ "VERSION_UNKNOWN": "unknown",
+ "DELETE_ACCOUNT": {
+ "TITLE": "Delete account",
+ "EXPLAIN": "Your account is blocked at once: no login, no public profile. After 30 days it is removed for good, with your library, backlog and stats.",
+ "BUTTON": "Delete my account",
+ "DIALOG_TITLE": "Delete your account?",
+ "TYPE_EMAIL": "Type your email to confirm",
+ "PASSWORD": "Password",
+ "CONFIRM": "Delete for good",
+ "CANCEL": "Cancel",
+ "DONE": "Your account is deleted.",
+ "WRONG_PASSWORD": "The password is wrong.",
+ "TOO_MANY": "Too many wrong passwords. Please try again in {{minutes}} minutes.",
+ "ERROR": "The account could not be deleted. Please try again later."
+ }
},
"VALIDATION": {
"EMAIL_REQUIRED": "Email is required.",
diff --git a/src/components/DeleteAccountCard.jsx b/src/components/DeleteAccountCard.jsx
new file mode 100644
index 0000000..1125d1d
--- /dev/null
+++ b/src/components/DeleteAccountCard.jsx
@@ -0,0 +1,112 @@
+import {useState} from 'react';
+import {useNavigate} from 'react-router-dom';
+import {useTranslation} from 'react-i18next';
+import {Loader2, Trash2} from 'lucide-react';
+import {toast} from 'sonner';
+
+import {Button} from '@/components/ui/button';
+import {Card, CardContent, CardHeader, CardTitle} from '@/components/ui/card';
+import {
+ Dialog,
+ DialogClose,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+ DialogTrigger,
+} from '@/components/ui/dialog';
+import {Input} from '@/components/ui/input';
+import {Label} from '@/components/ui/label';
+import {useResetAppearance} from '../context/PreferencesContext.jsx';
+import useSessionExpired from '../hooks/useSessionExpired.js';
+import {deleteAccount} from '../utils/account.js';
+import {clearSession} from '../utils/auth.js';
+
+const sameEmail = (typed, email) => !!email && typed.trim().toLowerCase() === email.toLowerCase();
+
+/**
+ * "Delete my account": Auth blocks the account at once and removes it after 30 days. The user types the own
+ * email against a misclick and the password against a borrowed session.
+ */
+export default function DeleteAccountCard({email}) {
+ const {t} = useTranslation();
+ const navigate = useNavigate();
+ const resetAppearance = useResetAppearance();
+ const expireSession = useSessionExpired();
+ const [typedEmail, setTypedEmail] = useState('');
+ const [password, setPassword] = useState('');
+ const [busy, setBusy] = useState(false);
+
+ const confirm = async () => {
+ setBusy(true);
+ try {
+ const response = await deleteAccount(password);
+ if (response.status === 204) {
+ clearSession();
+ resetAppearance();
+ toast.success(t('SETTINGS.DELETE_ACCOUNT.DONE'));
+ navigate('/', {replace: true});
+ return;
+ }
+ if (response.status === 401) {
+ expireSession();
+ } else if (response.status === 403) {
+ toast.error(t('SETTINGS.DELETE_ACCOUNT.WRONG_PASSWORD'));
+ } else if (response.status === 429) {
+ const minutes = Math.ceil(Number(response.headers.get('Retry-After') ?? 900) / 60);
+ toast.error(t('SETTINGS.DELETE_ACCOUNT.TOO_MANY', {minutes}));
+ } else {
+ toast.error(t('SETTINGS.DELETE_ACCOUNT.ERROR'));
+ }
+ } catch (err) {
+ console.error('Delete account error:', err);
+ toast.error(t('INFO.ERROR.NETWORK_FAILURE'));
+ }
+ setBusy(false);
+ };
+
+ return (
+
+
+ {t('SETTINGS.DELETE_ACCOUNT.TITLE')}
+
+
+