()
| 111 | } |
| 112 | |
| 113 | async function readCodexAuthFile(): Promise<CodexCliAuthFile | null> { |
| 114 | try { |
| 115 | const filePath = path.join(resolveCodexHome(), CODEX_AUTH_FILENAME) |
| 116 | const contents = await fs.readFile(filePath, "utf8") |
| 117 | return JSON.parse(contents) as CodexCliAuthFile |
| 118 | } catch { |
| 119 | return null |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | function extractIdToken(raw: CodexCliTokenSet["id_token"]): string | undefined { |
| 124 | if (!raw) return undefined |
no test coverage detected