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

Function clientOwnerFromPayload

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

Source from the content-addressed store, hash-verified

447 * (same-owner connects, or sessions written before this field), so `complete`
448 * falls back to the session owner. */
449const clientOwnerFromPayload = (payload: unknown): Owner | null => {
450 const decoded =
451 typeof payload === "string"
452 ? decodeJsonPayload(payload).pipe(Option.getOrElse(() => payload))
453 : payload;
454 if (decoded === null || typeof decoded !== "object") return null;
455 const value = (decoded as Record<string, unknown>).clientOwner;
456 return value === "user" || value === "org" ? value : null;
457};
458
459/** Narrow a stored `grant` string to the `OAuthGrant` union, or `null` when the
460 * 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