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

Function verifySession

apps/cloud/src/auth/ssr-gate.ts:83–97  ·  view source on GitHub ↗
(sealed: string)

Source from the content-addressed store, hash-verified

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

Callers 1

ssr-gate.tsFile · 0.85

Calls 2

sealedSessionDisplayNameFunction · 0.90
getRuntimeFunction · 0.85

Tested by

no test coverage detected