Improve security and error handling in backend functions

Update Supabase functions for cancel-email-change, detect-location, send-escalation-notification, and upload-image to enhance security and implement robust error handling.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a46bc7a0-bbf8-43ab-97c0-a58c66c2e365
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
This commit is contained in:
pac7
2025-10-08 12:06:35 +00:00
parent ccea99fecd
commit 0b57cba16f
4 changed files with 132 additions and 44 deletions

View File

@@ -213,7 +213,7 @@ serve(async (req) => {
console.error('Error in send-escalation-notification:', error);
return new Response(
JSON.stringify({
error: error.message,
error: error instanceof Error ? error.message : 'Unknown error occurred',
details: 'Failed to send escalation notification'
}),
{ status: 500, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }