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

Function clientOwnerFromPayload

packages/core/sdk/src/oauth-service.ts:297–305  ·  view source on GitHub ↗
(payload: unknown)

Source from the content-addressed store, hash-verified

295 * (same-owner connects, or sessions written before this field), so `complete`
296 * falls back to the session owner. */
297const clientOwnerFromPayload = (payload: unknown): Owner | null => {
298 const decoded =
299 typeof payload === "string"
300 ? decodeJsonPayload(payload).pipe(Option.getOrElse(() => payload))
301 : payload;
302 if (decoded === null || typeof decoded !== "object") return null;
303 const value = (decoded as Record<string, unknown>).clientOwner;
304 return value === "user" || value === "org" ? value : null;
305};
306
307/** Narrow a stored `grant` string to the `OAuthGrant` union, or `null` when the
308 * value is neither known grant. EXPLICIT — there is no silent fallback to

Callers 1

completeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected