2026-02-27
Better Changelog Deployment Progress
Auth Strategy Change
- Reverted to embedded Clerk auth β Sign-in/sign-up now use
<SignIn>and<SignUp>components instead of Account Portal redirect - Switched to test Clerk keys β Using pk_test/sk_test in Vercel production to bypass cross-subdomain session issues
- Root cause: Clerk satellite domain config between accounts.someshovels.com and changelog.someshovels.com wasnβt working correctly
Current State
- Working routes:
/(200),/sign-in(200),/sign-up(200),/changelog(200) - Failing route:
/dashboardβ Server-side exception (Digest: 684590147) due to Clerk subdomain auth issues - Forced production deploy in progress with test Clerk keys
Files Modified
apps/web/src/app/(auth)/sign-in/[[...sign-in]]/page.tsxβ Embedded<SignIn>componentapps/web/src/app/(auth)/sign-up/[[...sign-up]]/page.tsxβ Embedded<SignUp>component
Next Steps
- Verify deployment completes
- Test dashboard with test Clerk keys
- Fix Clerk satellite config properly later
Technical Notes
- Edge env vars: Use APP_DOMAIN (not NEXT_PUBLIC_APP_DOMAIN) for middleware β NEXT_PUBLIC_ not available in edge runtime
- Hardcoded domains: changelog.someshovels.com explicitly in middleware to avoid env var issues
- Demo tenant: slug=βdemoβ, id=β3bb57554-12f0-4d81-865f-f7e3607bdef8β
Key Decisions
- Keep test Clerk keys until functionality confirmed, then fix satellite config
- TEXT IDs in Prisma schema (not UUID) β all migrations aligned
Dashboard Cookie Fix (Critical)
Root cause found: getCurrentMember() in /tmp/better_changelog/apps/web/src/lib/auth.ts was calling setActiveTenantId(tenantId) which writes a cookie.
The problem: Next.js server components can only READ cookies, not WRITE them. The dashboard layout is a server component that calls getCurrentMember(), which was trying to write β crash.
Fix applied: Removed await setActiveTenantId(tenantId) call from getCurrentMember(). Cookies should only be set via explicit tenant-switch actions (e.g., user selecting a different workspace).
User context:
- Adamβs Clerk ID:
user_398ntOqR1NDv9OjCLgeL6fMnVUJ - Adamβs local user ID:
15b72b23-771f-480f-a709-b80450c7756c - Demo tenant: slug=βdemoβ, id=β3bb57554-12f0-4d81-865f-f7e3607bdef8β
Files Modified Today
/tmp/better_changelog/apps/web/src/lib/auth.tsβ Removed cookie write from getCurrentMember()/tmp/better_changelog/apps/web/src/app/api/health/route.tsβ Added for debugging auth chain- Dashboard error handling improved with graceful error page