You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: /api/usage accepts session cookies and derives quota from D1 tier
Two bugs in the Portal dashboard:
1. /api/usage required a Bearer API key, silently returning 401 for session
users → frontend fell back to quota:0. Dashboard showed "0 / 0 credits".
2. Quota was computed from AuthContext.quotaLimit which, for session users,
was 0. Now reads account.tier from D1 and maps via TIER_QUOTAS[tier].
handleUsageForAccount() is the session-safe entry point; handleUsage() stays
as the Bearer-auth entry point and delegates. Route tries session first, then
falls back to Bearer for SDK/CLI callers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments