MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / pickClientAuth

Function pickClientAuth

packages/core/sdk/src/oauth-helpers.ts:447–455  ·  view source on GitHub ↗
(
  clientSecret: string | null | undefined,
  method: ClientAuthMethod,
)

Source from the content-addressed store, hash-verified

445// ones, so an absent secret here unambiguously means "public client". The
446// `method` only chooses HOW a present secret is sent (post vs basic).
447const pickClientAuth = (
448 clientSecret: string | null | undefined,
449 method: ClientAuthMethod,
450): oauth.ClientAuth => {
451 if (!clientSecret) return oauth.None();
452 return method === "basic"
453 ? oauth.ClientSecretBasic(clientSecret)
454 : oauth.ClientSecretPost(clientSecret);
455};
456
457const tokenResponseFrom = (r: oauth.TokenEndpointResponse): OAuth2TokenResponse => ({
458 access_token: r.access_token,

Callers 3

refreshAccessTokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected