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

Function decodeOAuthCallbackState

packages/core/sdk/src/oauth.ts:73–83  ·  view source on GitHub ↗
(
  value: string | null | undefined,
)

Source from the content-addressed store, hash-verified

71 * the raw OAuth state unchanged.
72 */
73export const decodeOAuthCallbackState = (
74 value: string | null | undefined,
75): OAuthCallbackState | null => {
76 if (!value) return null;
77 const json = Result.getOrNull(Encoding.decodeBase64UrlString(value));
78 if (json === null) return null;
79 const decoded = Option.getOrNull(decodeOAuthCallbackStateJson(json));
80 if (decoded === null) return null;
81 const orgSlug = decoded.orgSlug.trim();
82 return orgSlug ? { state: decoded.state, orgSlug } : null;
83};

Calls

no outgoing calls

Tested by

no test coverage detected