()
| 12 | } |
| 13 | |
| 14 | export function accessTokenFromLocation(): string { |
| 15 | if (typeof window === "undefined") { |
| 16 | return ""; |
| 17 | } |
| 18 | return new URLSearchParams(window.location.search).get("simdeckToken") ?? ""; |
| 19 | } |
| 20 | |
| 21 | export function apiHeaders(headers: HeadersInit = {}): HeadersInit { |
| 22 | const token = accessTokenFromLocation(); |
no test coverage detected