MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / readSessionUserId

Function readSessionUserId

apps/ui/src/lib/api/openapi.ts:51–64  ·  view source on GitHub ↗
(response: Response)

Source from the content-addressed store, hash-verified

49}
50
51async function readSessionUserId(response: Response): Promise<string | null> {
52 try {
53 const body: unknown = await response.clone().json();
54 const userId = getProp(getProp(getProp(body, "data"), "user"), "id");
55
56 if (typeof userId === "string" && userId.length > 0) {
57 return userId;
58 }
59
60 return null;
61 } catch {
62 return null;
63 }
64}
65
66export async function performRefresh(): Promise<boolean> {
67 inFlightRefresh ??= (async (): Promise<boolean> => {

Callers 1

performRefreshFunction · 0.85

Calls 1

getPropFunction · 0.85

Tested by

no test coverage detected