MCPcopy Index your code
hub / github.com/freecodexyz/free-code / getCodexOAuthTokens

Function getCodexOAuthTokens

src/utils/auth.ts:1340–1357  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1338 * Returns null if no Codex tokens are stored.
1339 */
1340export 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).

Callers 3

isCodexSubscriberFunction · 0.85
getAnthropicClientFunction · 0.85
createCodexFetchFunction · 0.85

Calls 1

getGlobalConfigFunction · 0.85

Tested by

no test coverage detected