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

Function clientOwnerFromPayload

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

Source from the content-addressed store, hash-verified

397 * (same-owner connects, or sessions written before this field), so `complete`
398 * falls back to the session owner. */
399const clientOwnerFromPayload = (payload: unknown): Owner | null => {
400 const decoded =
401 typeof payload === "string"
402 ? decodeJsonPayload(payload).pipe(Option.getOrElse(() => payload))
403 : payload;
404 if (decoded === null || typeof decoded !== "object") return null;
405 const value = (decoded as Record<string, unknown>).clientOwner;
406 return value === "user" || value === "org" ? value : null;
407};
408
409/** Narrow a stored `grant` string to the `OAuthGrant` union, or `null` when the
410 * 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