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

Function providerAuthorizeExtras

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

Source from the content-addressed store, hash-verified

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

Callers 2

startFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected