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

Function verifySession

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

Source from the content-addressed store, hash-verified

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

Callers 1

ssr-gate.tsFile · 0.85

Calls 2

sealedSessionDisplayNameFunction · 0.90
getRuntimeFunction · 0.85

Tested by

no test coverage detected