mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-06-16 21:03:58 +08:00
fix(quota): detect Claude Team organizations instead of marking Free
Claude Team accounts report has_claude_pro=false and has_claude_max=false, so the plan detection fell through to plan_free even though the OAuth profile clearly identifies an active Claude Team organization. Inspect organization.organization_type and subscription_status before falling back to Free, and add a plan_team label across locales. Fixes router-for-me/Cli-Proxy-API-Management-Center#222
This commit is contained in:
@@ -974,6 +974,13 @@ const resolveClaudePlanType = (profile: ClaudeProfileResponse | null): string |
|
||||
const hasClaudePro = normalizeFlagValue(profile.account?.has_claude_pro);
|
||||
if (hasClaudePro) return 'plan_pro';
|
||||
|
||||
const organizationType = normalizeStringValue(profile.organization?.organization_type)?.toLowerCase();
|
||||
const subscriptionStatus = normalizeStringValue(profile.organization?.subscription_status)?.toLowerCase();
|
||||
|
||||
if (organizationType === 'claude_team' && subscriptionStatus === 'active') {
|
||||
return 'plan_team';
|
||||
}
|
||||
|
||||
if (hasClaudeMax === false && hasClaudePro === false) return 'plan_free';
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user