Phase 1: Route Structure & Admin Authentication ✅ Route Prefix Fixes: - All routes now use consistent /api prefix - Public: /groups/* → /api/groups/* - Admin: /groups/*, /moderation/* → /api/admin/* - Social Media: /api/social-media/* → /api/admin/social-media/* ✅ Admin API Authentication: - Created adminApi.js service with Bearer Token helpers * adminFetch() - Base fetch with Authorization header * adminGet() - GET with auto error handling * adminRequest() - POST/PUT/PATCH/DELETE with JSON * adminDownload() - For Blob downloads (CSV exports) - Added frontend/.env.example with REACT_APP_ADMIN_API_KEY - All /api/admin/* calls now use admin helpers ✅ Updated Components: - ModerationGroupsPage.js: All admin endpoints migrated - ModerationGroupImagesPage.js: Group loading + image deletion - PublicGroupImagesPage.js: Fixed public group route - DeletionLogSection.js: Deletion log endpoints - ConsentCheckboxes.js: Platform loading ⚠️ Next Steps: - Add user-friendly 403 error handling - Test all affected pages - Configure REACT_APP_ADMIN_API_KEY in deployment
10 lines
295 B
Plaintext
10 lines
295 B
Plaintext
# Frontend Environment Variables
|
|
|
|
# Admin API Authentication Token
|
|
# Generate with: openssl rand -hex 32
|
|
# Must match ADMIN_API_KEY in backend/.env
|
|
REACT_APP_ADMIN_API_KEY=your-secure-admin-token-here
|
|
|
|
# API Base URL (optional, defaults to same domain)
|
|
# REACT_APP_API_URL=http://localhost:3001
|