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

Function providerAuthorizeExtras

packages/core/sdk/src/oauth-helpers.ts:182–195  ·  view source on GitHub ↗
(
  authorizationUrl: string,
)

Source from the content-addressed store, hash-verified

180 * consent app, Google folds those unrelated scopes into the new consent flow and
181 * can fail inside accounts.google.com before returning to our callback. */
182export const providerAuthorizeExtras = (
183 authorizationUrl: string,
184): Readonly<Record<string, string>> => {
185 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: URL() throws on invalid input → no provider extras
186 try {
187 const host = new URL(authorizationUrl).host.toLowerCase();
188 if (host === "accounts.google.com") {
189 return { access_type: "offline", prompt: "consent" };
190 }
191 } catch {
192 // Unparseable authorization URL — let buildAuthorizationUrl surface the error.
193 }
194 return {};
195};
196
197// ---------------------------------------------------------------------------
198// Regional token-endpoint rebind

Callers 2

startFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected