fix(profile): Reauth für Passkey-Umbenennung und Geräte-Dialog
PATCH /credentials verlangt requireReauth wie add/delete; Client ruft reauthWithPasskey vor rename auf. Abbrechen-Text beim Gerät vergessen korrigiert. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -646,6 +646,8 @@ export async function removePasskey(credentialDbId: string): Promise<void> {
|
||||
}
|
||||
|
||||
export async function renamePasskey(credentialDbId: string, label: string): Promise<void> {
|
||||
await reauthWithPasskey()
|
||||
|
||||
await apiJson(`${API_BASE}/credentials/${credentialDbId}`, {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify({ label })
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user