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

Function verifySession

apps/cloud/src/auth/doc-gate.ts:91–105  ·  view source on GitHub ↗
(sealed: string)

Source from the content-addressed store, hash-verified

89// carries those in its Exit too) — so the login flow surfaces the real
90// problem instead of 500ing every page.
91const verifySession = async (sealed: string): Promise<VerifiedSession | null> => {
92 const exit = await getRuntime().runPromiseExit(
93 Effect.flatMap(WorkOSClient.asEffect(), (workos) => workos.authenticateSealedSession(sealed)),
94 );
95 if (!Exit.isSuccess(exit) || exit.value === null) return null;
96 const result = exit.value;
97 return {
98 userId: result.userId,
99 email: result.email,
100 name: sealedSessionDisplayName(result),
101 avatarUrl: result.avatarUrl ?? null,
102 organizationId: result.organizationId ?? null,
103 refreshedSession: result.refreshedSession,
104 };
105};
106
107// ── Auth hint ────────────────────────────────────────────────────────────────
108

Callers 1

doc-gate.tsFile · 0.85

Calls 2

sealedSessionDisplayNameFunction · 0.90
getRuntimeFunction · 0.85

Tested by

no test coverage detected