Adarsha23 / Adarsha23/petfeeder
[BUG] Cannot create pet profiles - RLS policy violation
- 主要言語
- JavaScript
- スター
- 1
- フォーク
- 0
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
**Description**:
```markdown
## Problem
Getting 403 Forbidden error when trying to create a pet profile through the frontend.
## Error Message
code: "42501" message: "new row violates row-level security policy for table "pet_profiles""
## Root Cause
The `002_fix_rls_policies.sql` script dropped all policies but didn't recreate the INSERT policy for `pet_profiles`.
## Steps to Reproduce
1. Login to dashboard
2. Click "Add Pet Profile"
3. Fill in pet details
4. Click "Create Profile"
5. Check browser console
6. See 403 error
## Expected Behavior
Pet profile should be created and saved to database
## Actual Behavior
Request fails with RLS policy violation
## Solution
Add INSERT policy:
```sql
CREATE POLICY "Users can insert their own pet profiles"
ON pet_profiles FOR INSERT
WITH CHECK (auth.uid() = user_id);
## Related Files
src/services/petProfileService.js
supabase/migrations/003_add_missing_policies.sql
## Branch
feature/supabase-integration
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。