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

Function encodeOAuthCallbackState

packages/core/sdk/src/oauth.ts:59–66  ·  view source on GitHub ↗
(input: {
  readonly state: string;
  readonly orgSlug?: string | null;
})

Source from the content-addressed store, hash-verified

57 * correct organization before completing the flow.
58 */
59export const encodeOAuthCallbackState = (input: {
60 readonly state: string;
61 readonly orgSlug?: string | null;
62}): string => {
63 const orgSlug = input.orgSlug?.trim();
64 if (!orgSlug) return input.state;
65 return Encoding.encodeBase64Url(encodeOAuthCallbackStateJson({ state: input.state, orgSlug }));
66};
67
68/** Decode a callback state value minted by `encodeOAuthCallbackState`.
69 *

Callers 3

startFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected