middleware.ts silently disables ALL auth when Clerk publishable key is a placeholder #13
Labels
No labels
blocked:needs-decision
bug
chore
in-progress
security/high
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AuWoMe/planish#13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
src/middleware.ts: when NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY is unset or still the template placeholder, hasValidPublishableKey is false and the default export becomes
() => NextResponse.next()— every protected route (including /api/trips, /api/items, /api/billing) is served unauthenticated. In production a missing/placeholder key should fail closed (500 or explicit auth-required), not open the API. Fix: always run clerkMiddleware; let Clerk fail requests when the key is invalid.