MCPcopy Create free account
hub / github.com/arctic-cli/interface / loadClaudeAuth

Function loadClaudeAuth

packages/arctic/src/auth/index.ts:327–342  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

325 }
326
327 async function loadClaudeAuth(): Promise<Info | null> {
328 const authFile = await readJsonFile<ClaudeOauthFile>(path.join(os.homedir(), ".claude", ".credentials.json"))
329 if (!authFile?.claudeAiOauth) return null
330
331 const { accessToken, refreshToken, expiresAt } = authFile.claudeAiOauth
332 if (!accessToken || !refreshToken) return null
333
334 const expires = typeof expiresAt === "number" && Number.isFinite(expiresAt) ? expiresAt : Date.now() + 3600 * 1000
335
336 return {
337 type: "oauth",
338 access: accessToken,
339 refresh: refreshToken,
340 expires,
341 }
342 }
343
344 async function loadExternalAuth(): Promise<Record<string, Info>> {
345 const entries: Record<string, Info> = {}

Callers 1

loadExternalAuthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected