(accessToken: string)
| 252 | } |
| 253 | |
| 254 | async function fetchWhoami(accessToken: string): Promise<WhoamiResponse> { |
| 255 | const response = await fetch(`${getBaseUrl()}/api/dashboard/whoami`, { |
| 256 | headers: { |
| 257 | Authorization: `Bearer ${accessToken}`, |
| 258 | }, |
| 259 | }); |
| 260 | |
| 261 | if (!response.ok) { |
| 262 | throw new Error("Failed to fetch user info"); |
| 263 | } |
| 264 | |
| 265 | return (await response.json()) as WhoamiResponse; |
| 266 | } |
no test coverage detected