Skip to content

Commit e1f309f

Browse files
committed
refactor: update input handling for audit log in authActionClient
- Modified the input structure for the audit log by excluding file data from client input, improving data privacy and clarity in logging. - Ensured that only relevant user and action information is captured in the audit log.
1 parent af52289 commit e1f309f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/app/src/actions/safe-action.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,15 @@ export const authActionClient = actionClientWithMeta
154154
throw new Error('Member not found');
155155
}
156156

157+
const { fileData: _, ...inputForAuditLog } = clientInput as any;
158+
157159
const data = {
158160
userId: session.user.id,
159161
email: session.user.email,
160162
name: session.user.name,
161163
organizationId: session.session.activeOrganizationId,
162164
action: metadata.name,
163-
input: clientInput,
165+
input: inputForAuditLog,
164166
ipAddress: headersList.get('x-forwarded-for') || null,
165167
userAgent: headersList.get('user-agent') || null,
166168
};

0 commit comments

Comments
 (0)