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

Function clientOwnerFromPayload

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

Source from the content-addressed store, hash-verified

272 * (same-owner connects, or sessions written before this field), so `complete`
273 * falls back to the session owner. */
274const clientOwnerFromPayload = (payload: unknown): Owner | null => {
275 const decoded =
276 typeof payload === "string"
277 ? decodeJsonPayload(payload).pipe(Option.getOrElse(() => payload))
278 : payload;
279 if (decoded === null || typeof decoded !== "object") return null;
280 const value = (decoded as Record<string, unknown>).clientOwner;
281 return value === "user" || value === "org" ? value : null;
282};
283
284/** Narrow a stored `grant` string to the `OAuthGrant` union, or `null` when the
285 * 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