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

Function verifySession

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

Source from the content-addressed store, hash-verified

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

Callers 1

doc-gate.tsFile · 0.85

Calls 2

sealedSessionDisplayNameFunction · 0.90
getRuntimeFunction · 0.85

Tested by

no test coverage detected