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

Function providerAuthorizeExtras

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

Source from the content-addressed store, hash-verified

249 * consent app, Google folds those unrelated scopes into the new consent flow and
250 * can fail inside accounts.google.com before returning to our callback. */
251export const providerAuthorizeExtras = (
252 authorizationUrl: string,
253): Readonly<Record<string, string>> => {
254 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: URL() throws on invalid input → no provider extras
255 try {
256 const host = new URL(authorizationUrl).host.toLowerCase();
257 if (host === "accounts.google.com") {
258 return { access_type: "offline", prompt: "consent" };
259 }
260 } catch {
261 // Unparseable authorization URL — let buildAuthorizationUrl surface the error.
262 }
263 return {};
264};
265
266// ---------------------------------------------------------------------------
267// Regional token-endpoint rebind

Callers 2

startFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected