mirror of
https://github.com/coleam00/Archon.git
synced 2025-12-24 02:39:17 -05:00
Add Supabase key validation and simplify frontend state management
- Add backend validation to detect and warn about anon vs service keys - Prevent startup with incorrect Supabase key configuration - Consolidate frontend state management following KISS principles - Remove duplicate state tracking and sessionStorage polling - Add clear error display when backend fails to start - Improve .env.example documentation with detailed key selection guide - Add comprehensive test coverage for validation logic - Remove unused test results checking to eliminate 404 errors The implementation now warns users about key misconfiguration while maintaining backward compatibility. Frontend state is simplified with MainLayout as the single source of truth for backend status.
This commit is contained in:
19
.env.example
19
.env.example
@@ -5,9 +5,22 @@
|
||||
# https://supabase.com/dashboard/project/<your project ID>/settings/api
|
||||
SUPABASE_URL=
|
||||
|
||||
# Get your SUPABASE_SERVICE_KEY from the API Keys section of your Supabase project settings -
|
||||
# https://supabase.com/dashboard/project/<your project ID>/settings/api-keys
|
||||
# On this page it is called the service_role secret.
|
||||
# ⚠️ CRITICAL: You MUST use the SERVICE ROLE key, NOT the Anon key! ⚠️
|
||||
#
|
||||
# COMMON MISTAKE: Using the anon (public) key will cause ALL saves to fail with "permission denied"!
|
||||
#
|
||||
# How to get the CORRECT key:
|
||||
# 1. Go to: https://supabase.com/dashboard/project/<your project ID>/settings/api
|
||||
# 2. In the Settings menu, click on "API keys"
|
||||
# 3. Find "Project API keys" section
|
||||
# 4. You will see TWO keys - choose carefully:
|
||||
# ❌ anon (public): WRONG - This is shorter, starts with "eyJhbGc..." and contains "anon" in the JWT
|
||||
# ✅ service_role (secret): CORRECT - This is longer and contains "service_role" in the JWT
|
||||
#
|
||||
# The service_role key is typically much longer than the anon key.
|
||||
# If you see errors like "Failed to save" or "Permission denied", you're using the wrong key!
|
||||
#
|
||||
# On the Supabase dashboard, it's labeled as "service_role" under "Project API keys"
|
||||
SUPABASE_SERVICE_KEY=
|
||||
|
||||
# Optional: Set log level for debugging
|
||||
|
||||
Reference in New Issue
Block a user