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