Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@
import type { AuthResult, AuthServiceRpc, Tier } from './types.js';

function isApiKey(token: string): boolean {
return token.startsWith('sb_live_') || token.startsWith('sb_test_');
// Must match edge-auth's `resolvePrincipal` / `extractKeyPrefix` — edge-auth
// is the SoT for key format. The old `sb_*` checks are legacy from the
// pre-migration stackbilt-auth era and were never updated when edge-auth
// took over and started minting `ea_*` keys.
return (
token.startsWith('ea_') ||
token.startsWith('sb_live_') ||
token.startsWith('sb_test_')
);
}

function mapError(error?: string): string {
Expand Down
Loading