Fix remaining compliance violations

This commit is contained in:
gpt-engineer-app[bot]
2025-11-03 18:47:59 +00:00
parent 6efb6dda66
commit 7663205512
9 changed files with 131 additions and 83 deletions

View File

@@ -85,11 +85,15 @@ Deno.serve(async (req) => {
.rpc('cancel_user_email_change', { _user_id: userId });
if (cancelError || !cancelled) {
console.error('Error cancelling email change:', cancelError);
edgeLogger.error('Error cancelling email change', {
error: cancelError?.message,
userId,
requestId: tracking.requestId
});
throw new Error('Unable to cancel email change: ' + (cancelError?.message || 'Unknown error'));
}
console.log(`Successfully cancelled email change for user ${userId}`);
edgeLogger.info('Successfully cancelled email change', { userId, requestId: tracking.requestId });
// Log the cancellation in admin_audit_log
const { error: auditError } = await supabaseAdmin
@@ -104,7 +108,10 @@ Deno.serve(async (req) => {
});
if (auditError) {
console.error('Error logging audit:', auditError);
edgeLogger.error('Error logging audit', {
error: auditError.message,
requestId: tracking.requestId
});
// Don't fail the request if audit logging fails
}