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

Function sessionFromSealed

apps/cloud/src/auth/middleware.ts:93–104  ·  view source on GitHub ↗
(
  result: SealedSessionResult,
  sealedSessionFallback: string,
)

Source from the content-addressed store, hash-verified

91 * `SessionAuthLive`, `""` for the account API which never re-sets the cookie).
92 */
93export const sessionFromSealed = (
94 result: SealedSessionResult,
95 sealedSessionFallback: string,
96): Session => ({
97 accountId: result.userId,
98 email: result.email,
99 name: sealedSessionDisplayName(result),
100 avatarUrl: result.avatarUrl ?? null,
101 organizationId: result.organizationId ?? null,
102 sealedSession: result.refreshedSession ?? sealedSessionFallback,
103 refreshedSession: result.refreshedSession ?? null,
104});
105
106// ---------------------------------------------------------------------------
107// SessionAuth — resolves the WorkOS session cookie; provides SessionContext AND

Callers 3

middleware-live.tsFile · 0.90
auth-middleware.tsFile · 0.90
account-api.tsFile · 0.90

Calls 1

sealedSessionDisplayNameFunction · 0.85

Tested by

no test coverage detected