(response: Response)
| 49 | } |
| 50 | |
| 51 | async 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 | |
| 66 | export async function performRefresh(): Promise<boolean> { |
| 67 | inFlightRefresh ??= (async (): Promise<boolean> => { |
no test coverage detected