pezkuwichain 205e22e083 fix: Use SECURITY DEFINER function for profile upserts
Changes:
1. Created migration 004_create_upsert_function.sql:
   - Creates upsert_user_profile() function with SECURITY DEFINER
   - Bypasses RLS to allow profile creation/updates
   - Only accessible to authenticated users via auth.uid()

2. Updated ProfileSettings.tsx:
   - Changed from direct upsert to RPC function call
   - Updated updateProfile() to use supabase.rpc()
   - Updated updateNotificationSettings() to use same function

This solves the RLS policy violation by using a secure
server-side function that properly handles authentication.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 05:10:53 +03:00
2025-10-22 18:05:19 -07:00
S
Description
No description provided
Readme MIT 107 MiB
Languages
HTML 75.2%
TypeScript 21.3%
Rust 1.9%
PLpgSQL 0.7%
JavaScript 0.6%
Other 0.2%