Skip to content

Commit 88a8a85

Browse files
committed
refactor(tools): detect the saved-credential picker with isSavedCredentialPicker
credentialSuppliedParamsFor matched any oauth-input feeding oauthCredential, without the credentialKind === 'service-account' check isSavedCredentialPicker applies. It now uses that predicate. No registered block changes: every block whose loose-match picker lacks the service-account kind has no tool that declares credentialSuppliedParams.
1 parent 1a8ef09 commit 88a8a85

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎apps/sim/tools/shared/saved-credentials.ts‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,9 @@ export function isSavedCredentialPicker(
7878
*/
7979
export function credentialSuppliedParamsFor(
8080
oauth: Pick<OAuthConfig, 'credentialSuppliedParams'> | undefined,
81-
subBlocks: readonly Pick<SubBlockConfig, 'canonicalParamId' | 'type'>[]
81+
subBlocks: readonly Pick<SubBlockConfig, 'type' | 'credentialKind' | 'canonicalParamId'>[]
8282
): ReadonlySet<string> {
83-
const hasPicker = subBlocks.some(
84-
(subBlock) => subBlock.type === 'oauth-input' && subBlock.canonicalParamId === 'oauthCredential'
85-
)
86-
return new Set(hasPicker ? oauth?.credentialSuppliedParams : [])
83+
return new Set(subBlocks.some(isSavedCredentialPicker) ? oauth?.credentialSuppliedParams : [])
8784
}
8885

8986
/**

0 commit comments

Comments
 (0)