From 68af8c63615856de9e91b9d9920eaa4c00e6f4b8 Mon Sep 17 00:00:00 2001 From: elpatron Date: Sun, 31 May 2026 09:59:44 +0200 Subject: [PATCH] =?UTF-8?q?fix(profile):=20Reauth=20f=C3=BCr=20Passkey-Umb?= =?UTF-8?q?enennung=20und=20Ger=C3=A4te-Dialog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PATCH /credentials verlangt requireReauth wie add/delete; Client ruft reauthWithPasskey vor rename auf. Abbrechen-Text beim Gerät vergessen korrigiert. Co-authored-by: Cursor --- client/src/components/UserProfilePage.tsx | 2 +- client/src/i18n/locales/de.json | 1 + client/src/i18n/locales/en.json | 1 + client/src/services/auth.ts | 2 ++ server/src/routes/auth.ts | 2 +- 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/components/UserProfilePage.tsx b/client/src/components/UserProfilePage.tsx index 60eccdc..d4ff5d5 100644 --- a/client/src/components/UserProfilePage.tsx +++ b/client/src/components/UserProfilePage.tsx @@ -240,7 +240,7 @@ export default function UserProfilePage({ onBack, onLogout }: UserProfilePagePro t('profile.device_forget_confirm_desc'), t('profile.device_forget_confirm_title'), t('profile.device_forget_confirm_yes'), - t('profile.remove_passkey_confirm_no') + t('profile.device_forget_confirm_no') ) if (!confirmed) return diff --git a/client/src/i18n/locales/de.json b/client/src/i18n/locales/de.json index cc82aa5..84101c8 100644 --- a/client/src/i18n/locales/de.json +++ b/client/src/i18n/locales/de.json @@ -347,6 +347,7 @@ "device_forget_confirm_title": "Schnell-Login entfernen?", "device_forget_confirm_desc": "Der Account verschwindet aus der Schnell-Login-Liste auf diesem Gerät. Deine Session und lokalen Logbücher bleiben erhalten.", "device_forget_confirm_yes": "Entfernen", + "device_forget_confirm_no": "Abbrechen", "passkey_label": "Name für neuen Passkey (optional)", "passkey_label_placeholder": "z. B. MacBook, iPhone", "passkey_rename_btn": "Name speichern", diff --git a/client/src/i18n/locales/en.json b/client/src/i18n/locales/en.json index 690249a..8790273 100644 --- a/client/src/i18n/locales/en.json +++ b/client/src/i18n/locales/en.json @@ -347,6 +347,7 @@ "device_forget_confirm_title": "Remove quick login?", "device_forget_confirm_desc": "The account will be removed from the quick-login list on this device. Your session and local logbooks stay on this device.", "device_forget_confirm_yes": "Remove", + "device_forget_confirm_no": "Cancel", "passkey_label": "Name for new passkey (optional)", "passkey_label_placeholder": "e.g. MacBook, iPhone", "passkey_rename_btn": "Save name", diff --git a/client/src/services/auth.ts b/client/src/services/auth.ts index a7c1814..f0711c6 100644 --- a/client/src/services/auth.ts +++ b/client/src/services/auth.ts @@ -646,6 +646,8 @@ export async function removePasskey(credentialDbId: string): Promise { } export async function renamePasskey(credentialDbId: string, label: string): Promise { + await reauthWithPasskey() + await apiJson(`${API_BASE}/credentials/${credentialDbId}`, { method: 'PATCH', body: JSON.stringify({ label }) diff --git a/server/src/routes/auth.ts b/server/src/routes/auth.ts index 6b852b5..5c1c07b 100644 --- a/server/src/routes/auth.ts +++ b/server/src/routes/auth.ts @@ -587,7 +587,7 @@ router.post('/add-credential-verify', requireReauth, async (req: any, res) => { } }) -router.patch('/credentials/:id', requireUser, async (req: any, res) => { +router.patch('/credentials/:id', requireReauth, async (req: any, res) => { try { const { id } = req.params const label = normalizeCredentialLabel(req.body?.label)