Skip to content

Commit 4c1aeaf

Browse files
committed
feat: Add JWT authentication to all API calls in settings and dashboard
- Fixed settings.tsx: Added Clerk auth tokens to connection-status, disconnect-linkedin, disconnect-github, and save-settings API calls - Fixed dashboard.tsx: Added auth tokens to 7 API calls (loadScheduledPosts, checkAuthentication, loadUsage, loadUserSettings, loadPostHistory, loadStats, savePost) - Updated .env.example with missing variables (CLERK_ISSUER, DEV_MODE, DATABASE_URL, ENCRYPTION_KEY, ADMIN_EMAIL) - Fixed bare except clauses with debug logging in post_history.py and ai_service.py - Removed deprecated dashboard-old.tsx - Added errorHandler.ts utility for consistent frontend error handling - Security: DEV_MODE bypass now requires explicit DEV_MODE=true
1 parent 5c7263a commit 4c1aeaf

File tree

14 files changed

+701
-159
lines changed

14 files changed

+701
-159
lines changed

.env.example

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,32 @@ UNSPLASH_ACCESS_KEY=your_unsplash_access_key_here
7676
# 4. Copy the Signing Secret below
7777
CLERK_WEBHOOK_SECRET=whsec_your_signing_secret_here
7878

79+
# Clerk issuer URL for JWT verification (REQUIRED for production)
80+
# Format: https://your-clerk-instance.clerk.accounts.dev
81+
CLERK_ISSUER=https://your-clerk-instance.clerk.accounts.dev
82+
83+
# Development mode (set to 'true' only for local development)
84+
# WARNING: Never set to 'true' in production!
85+
DEV_MODE=false
86+
87+
# ========================================
88+
# DATABASE (Production)
89+
# ========================================
90+
# PostgreSQL connection string for production
91+
# Format: postgresql://user:password@host:5432/database
92+
# Leave unset for local SQLite fallback
93+
# DATABASE_URL=postgresql://user:password@host:5432/database
94+
95+
# ========================================
96+
# SECURITY - Token Encryption
97+
# ========================================
98+
# 32-byte key for encrypting OAuth tokens at rest
99+
# Generate with: python -c "import secrets; print(secrets.token_hex(32))"
100+
ENCRYPTION_KEY=your_64_char_hex_key_here
101+
102+
# Admin email for receiving feedback notifications
103+
ADMIN_EMAIL=[email protected]
104+
79105
# ========================================
80106
# DATABASE PATHS (Optional)
81107
# ========================================

0 commit comments

Comments
 (0)