fix(dashboard): keep copilot-m365-web first in providerSupportsOAuth (#20573)

Restructure the keychain-only exclusion so the copilot-m365-web branch stays
the first, unconditional operand (copilot-m365-web is never keychain-only).
Same behaviour; keeps the m365-native-catalog-auth source contract.
This commit is contained in:
diegosouzapw
2026-11-19 23:34:46 -03:00
parent 3eefe55eec
commit 04f84e859c

View File

@@ -303,16 +303,18 @@ export default function ProviderDetailPageClient() {
);
const oauthProviderId = resolveProviderOAuthBackendId(providerId, providerInfo);
const isKeychainImportOnly = KEYCHAIN_IMPORT_ONLY_PROVIDERS.has(providerId);
// Keychain-import-only providers (zed) never get the OAuth add flow (#20573).
// copilot-m365-web is not keychain-only, so it stays first and unconditional.
const providerSupportsOAuth =
!isKeychainImportOnly &&
(providerId === "copilot-m365-web" ||
providerInfo?.toggleAuthType === "oauth" ||
providerInfo?.toggleAuthType === "free" ||
oauthProviderId !== providerId ||
// A no-auth provider can still offer a dashboard sign-in: MiniMax Code
// takes an account code here and writes the credential into the local
// MiniMax Code profile.
supportsDeviceCodeLogin(providerId));
providerId === "copilot-m365-web" ||
(!isKeychainImportOnly &&
(providerInfo?.toggleAuthType === "oauth" ||
providerInfo?.toggleAuthType === "free" ||
oauthProviderId !== providerId ||
// A no-auth provider can still offer a dashboard sign-in: MiniMax Code
// takes an account code here and writes the credential into the local
// MiniMax Code profile.
supportsDeviceCodeLogin(providerId)));
const subscriptionRisk = providerInfo?.subscriptionRisk === true;
// ── Phase 1t.3: connection gate + risk-notice modal state ───────────────