(response: Response)
| 176 | }); |
| 177 | |
| 178 | const readJson = async (response: Response): Promise<Record<string, unknown>> => { |
| 179 | const text = await response.text(); |
| 180 | if (!text) return {}; |
| 181 | try { |
| 182 | return JSON.parse(text) as Record<string, unknown>; |
| 183 | } catch { |
| 184 | return { error: "invalid_response", error_description: text.slice(0, 200) }; |
| 185 | } |
| 186 | }; |
| 187 | |
| 188 | export const discoverCliLogin = async ( |
| 189 | origin: string, |
no test coverage detected