From bc81fd7db2d4aeb6749f777a0b458b117807d496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 10 May 2026 13:55:34 +0200 Subject: [PATCH] fix(admin): translate native-token audit actions, link recent rows Two related improvements to the admin recent-activity surface: - New audit actions `auth.token.autoissue.native`, `auth.token.refresh`, and `auth.token.revoke` were leaking through both the dashboard preview and the Login Overview viewer as raw event keys. Added translations and wired the three keys through the action-label map shared by both components. - Recent-activity rows on /admin were a dead-end: a failed login row showed "Unknown" + "Failed" with no link, no IP, no way to drill in. Each row is now a Link into /admin/login-overview, with the IP shown inline at sm+. Co-Authored-By: Claude Opus 4.7 (1M context) --- messages/de.json | 3 + messages/en.json | 3 + .../admin/login-overview-section.tsx | 3 + src/components/admin/recent-audit-preview.tsx | 59 +++++++++++-------- 4 files changed, 45 insertions(+), 23 deletions(-) diff --git a/messages/de.json b/messages/de.json index 3920ccab7..df59c5ba1 100644 --- a/messages/de.json +++ b/messages/de.json @@ -1737,6 +1737,9 @@ "authLogout": "Abmeldung", "authPasskeyRegister": "Passkey hinzugefügt", "authPasskeyDelete": "Passkey gelöscht", + "authTokenAutoissueNative": "Native-Client-Token ausgestellt", + "authTokenRefresh": "Token erneuert", + "authTokenRevoke": "Token widerrufen", "medicationReminders": "Medikamentenerinnerungen", "medicationRemindersDescription": "Schwellenwerte für die Farbübergänge der Erinnerungs-Badges auf den Medikamentenkarten.", "reminderLateMinutes": "Spät-Schwellenwert (Minuten)", diff --git a/messages/en.json b/messages/en.json index 030e2b3b7..53f8a2740 100644 --- a/messages/en.json +++ b/messages/en.json @@ -1737,6 +1737,9 @@ "authLogout": "Logout", "authPasskeyRegister": "Passkey added", "authPasskeyDelete": "Passkey deleted", + "authTokenAutoissueNative": "Native client token issued", + "authTokenRefresh": "Token refreshed", + "authTokenRevoke": "Token revoked", "medicationReminders": "Medication Reminders", "medicationRemindersDescription": "Thresholds for reminder badge color transitions on medication cards.", "reminderLateMinutes": "Late threshold (minutes)", diff --git a/src/components/admin/login-overview-section.tsx b/src/components/admin/login-overview-section.tsx index 1212a7770..c14fb7248 100644 --- a/src/components/admin/login-overview-section.tsx +++ b/src/components/admin/login-overview-section.tsx @@ -76,6 +76,9 @@ export function LoginOverviewSection() { "auth.logout": t("admin.authLogout"), "auth.passkey.register": t("admin.authPasskeyRegister"), "auth.passkey.delete": t("admin.authPasskeyDelete"), + "auth.token.autoissue.native": t("admin.authTokenAutoissueNative"), + "auth.token.refresh": t("admin.authTokenRefresh"), + "auth.token.revoke": t("admin.authTokenRevoke"), }; // Build the query string once so it's reused by the data-query key, the diff --git a/src/components/admin/recent-audit-preview.tsx b/src/components/admin/recent-audit-preview.tsx index 2d0d5c52e..c39ff2ebd 100644 --- a/src/components/admin/recent-audit-preview.tsx +++ b/src/components/admin/recent-audit-preview.tsx @@ -56,6 +56,9 @@ export function RecentAuditPreview() { "auth.logout": t("admin.authLogout"), "auth.passkey.register": t("admin.authPasskeyRegister"), "auth.passkey.delete": t("admin.authPasskeyDelete"), + "auth.token.autoissue.native": t("admin.authTokenAutoissueNative"), + "auth.token.refresh": t("admin.authTokenRefresh"), + "auth.token.revoke": t("admin.authTokenRevoke"), }; const entries = data?.entries ?? []; @@ -116,31 +119,41 @@ export function RecentAuditPreview() {