MCPcopy Index your code
hub / github.com/codeaashu/claude-code / saveClientInformation

Method saveClientInformation

src/services/mcp/auth.ts:1513–1538  ·  view source on GitHub ↗
(
    clientInformation: OAuthClientInformationFull,
  )

Source from the content-addressed store, hash-verified

1511 }
1512
1513 async saveClientInformation(
1514 clientInformation: OAuthClientInformationFull,
1515 ): Promise<void> {
1516 const storage = getSecureStorage()
1517 const existingData = storage.read() || {}
1518 const serverKey = getServerKey(this.serverName, this.serverConfig)
1519
1520 const updatedData: SecureStorageData = {
1521 ...existingData,
1522 mcpOAuth: {
1523 ...existingData.mcpOAuth,
1524 [serverKey]: {
1525 ...existingData.mcpOAuth?.[serverKey],
1526 serverName: this.serverName,
1527 serverUrl: this.serverConfig.url,
1528 clientId: clientInformation.client_id,
1529 clientSecret: clientInformation.client_secret,
1530 // Provide default values for required fields if not present
1531 accessToken: existingData.mcpOAuth?.[serverKey]?.accessToken || '',
1532 expiresAt: existingData.mcpOAuth?.[serverKey]?.expiresAt || 0,
1533 },
1534 },
1535 }
1536
1537 storage.update(updatedData)
1538 }
1539
1540 async tokens(): Promise<OAuthTokens | undefined> {
1541 // Cross-process token changes (another CC instance refreshed or invalidated)

Callers

nothing calls this directly

Calls 4

getSecureStorageFunction · 0.85
getServerKeyFunction · 0.85
readMethod · 0.65
updateMethod · 0.65

Tested by

no test coverage detected