fix: freeTier/apikey providers without authModes default to apikey in dualAuthTypes
Free-tier and apikey providers (e.g. cloudflare-ai, byteplus, ollama, vertex) whose registry entry omits authModes were treated as oauth-only, hiding their apikey connections on the providers grid card.
This commit is contained in:
@@ -283,7 +283,15 @@ export default function ProvidersPage() {
|
||||
const dualAuthTypes = (info, key) => {
|
||||
if (key === "kiro") return ["oauth", "apikey", "api_key"];
|
||||
const modes = info?.authModes;
|
||||
if (!Array.isArray(modes) || !modes.includes("apikey")) return "oauth";
|
||||
// Free-tier and API-key providers default to supporting apikey even when the
|
||||
// registry entry omits authModes (e.g. cloudflare-ai, byteplus, ollama,
|
||||
// vertex) — otherwise their apikey connections are invisible on the grid card.
|
||||
if (!Array.isArray(modes)) {
|
||||
return key in FREE_TIER_PROVIDERS || key in APIKEY_PROVIDERS
|
||||
? ["oauth", "apikey", "api_key"]
|
||||
: "oauth";
|
||||
}
|
||||
if (!modes.includes("apikey")) return "oauth";
|
||||
return ["oauth", "apikey", "api_key"];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user