()
| 1338 | * Returns null if no Codex tokens are stored. |
| 1339 | */ |
| 1340 | export function getCodexOAuthTokens(): CodexTokens | null { |
| 1341 | const cfg = getGlobalConfig() |
| 1342 | const stored = cfg.codexOAuth |
| 1343 | if ( |
| 1344 | !stored?.accessToken || |
| 1345 | !stored.refreshToken || |
| 1346 | !stored.expiresAt || |
| 1347 | !stored.accountId |
| 1348 | ) { |
| 1349 | return null |
| 1350 | } |
| 1351 | return { |
| 1352 | accessToken: stored.accessToken, |
| 1353 | refreshToken: stored.refreshToken, |
| 1354 | expiresAt: stored.expiresAt, |
| 1355 | accountId: stored.accountId, |
| 1356 | } |
| 1357 | } |
| 1358 | |
| 1359 | /** |
| 1360 | * Removes Codex OAuth tokens from GlobalConfig (e.g., on logout). |
no test coverage detected