(sealed: string)
| 81 | // carries those in its Exit too) — so the login flow surfaces the real |
| 82 | // problem instead of 500ing every page. |
| 83 | const 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 |
no test coverage detected