Fix platform_settings table name and RLS policy
- Update migration to use correct table name (platform_settings, not site_settings) - Fix WebinarRecording.tsx to query platform_settings table - Fix Bootcamp.tsx to query platform_settings table - This allows authenticated users to access brand_accent_color for theming 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -106,7 +106,7 @@ export default function Bootcamp() {
|
|||||||
|
|
||||||
// Fetch accent color from settings
|
// Fetch accent color from settings
|
||||||
const { data: settings } = await supabase
|
const { data: settings } = await supabase
|
||||||
.from('site_settings')
|
.from('platform_settings')
|
||||||
.select('brand_accent_color')
|
.select('brand_accent_color')
|
||||||
.single();
|
.single();
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export default function WebinarRecording() {
|
|||||||
|
|
||||||
// Fetch accent color from settings
|
// Fetch accent color from settings
|
||||||
const { data: settings } = await supabase
|
const { data: settings } = await supabase
|
||||||
.from('site_settings')
|
.from('platform_settings')
|
||||||
.select('brand_accent_color')
|
.select('brand_accent_color')
|
||||||
.single();
|
.single();
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
-- Make site_settings publicly accessible for accent color
|
-- Make platform_settings publicly accessible for accent color
|
||||||
-- All users (authenticated) can read brand settings
|
-- All users (authenticated) can read brand settings
|
||||||
|
|
||||||
DROP POLICY IF EXISTS "site_settings_public_select" ON site_settings;
|
DROP POLICY IF EXISTS "platform_settings_public_select" ON platform_settings;
|
||||||
|
|
||||||
CREATE POLICY "site_settings_public_select"
|
CREATE POLICY "platform_settings_public_select"
|
||||||
ON site_settings
|
ON platform_settings
|
||||||
FOR SELECT
|
FOR SELECT
|
||||||
TO authenticated
|
TO authenticated
|
||||||
USING (true);
|
USING (true);
|
||||||
|
|||||||
Reference in New Issue
Block a user