mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 17:31:12 -05:00
Add system phase 4 audits
- Add audit logging for system maintenance operations (cache/orphaned images/manual cleanup) - Log account deletion request handling (requests/confirm/cancel) - Log security actions (admin password resets, MFA enforcement changes, account lockouts)
This commit is contained in:
@@ -257,6 +257,21 @@ export async function addPasswordToAccount(): Promise<IdentityOperationResult> {
|
||||
method: 'reset_password_flow',
|
||||
timestamp: new Date().toISOString()
|
||||
});
|
||||
|
||||
// Log to admin audit trail for security tracking
|
||||
try {
|
||||
const { logAdminAction } = await import('@/lib/adminActionAuditHelpers');
|
||||
await logAdminAction(
|
||||
'password_setup_initiated',
|
||||
{
|
||||
method: 'reset_password_email',
|
||||
email: userEmail,
|
||||
has_oauth: true, // If they're adding password, they must have OAuth
|
||||
}
|
||||
);
|
||||
} catch (auditError) {
|
||||
// Non-critical - don't fail operation if audit logging fails
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
|
||||
Reference in New Issue
Block a user