feat(audit): add authentication method tracking in audit logs
This commit is contained in:
@@ -473,6 +473,12 @@ export function DetailsDialog(props: DetailsDialogProps) {
|
||||
if (hasUsername) return String(username)
|
||||
return `ID: ${id}`
|
||||
})()
|
||||
const authMethodLabel = (() => {
|
||||
if (!isManage || !props.isAdmin || !adminInfo?.auth_method) return ''
|
||||
if (adminInfo.auth_method === 'access_token') return t('Access Token')
|
||||
if (adminInfo.auth_method === 'session') return t('Session')
|
||||
return String(adminInfo.auth_method)
|
||||
})()
|
||||
|
||||
// Localized operation text rendered from the language-independent op
|
||||
// descriptor (shared by audit type=3 and login type=7).
|
||||
@@ -806,6 +812,12 @@ export function DetailsDialog(props: DetailsDialogProps) {
|
||||
{operationText != null && (
|
||||
<DetailRow label={t('Operation')} value={operationText} />
|
||||
)}
|
||||
{authMethodLabel !== '' && (
|
||||
<DetailRow
|
||||
label={t('Authentication Method')}
|
||||
value={authMethodLabel}
|
||||
/>
|
||||
)}
|
||||
{changedFieldsText !== '' && (
|
||||
<DetailRow
|
||||
label={t('Changed Fields')}
|
||||
|
||||
@@ -110,6 +110,7 @@ export interface LogOtherData {
|
||||
admin_username?: string
|
||||
admin_id?: number | string
|
||||
admin_role?: number
|
||||
auth_method?: 'session' | 'access_token' | string
|
||||
}
|
||||
// Language-independent operation descriptor (audit/login logs).
|
||||
// Frontend renders localized content from action + params via i18n templates.
|
||||
|
||||
Reference in New Issue
Block a user