MCPcopy
hub / github.com/codeaashu/claude-code / removeApiKey

Function removeApiKey

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

Source from the content-addressed store, hash-verified

1168}
1169
1170export async function removeApiKey(): Promise<void> {
1171 await maybeRemoveApiKeyFromMacOSKeychain()
1172
1173 // Also remove from config instead of returning early, for older clients
1174 // that set keys before we supported keychain.
1175 saveGlobalConfig(current => ({
1176 ...current,
1177 primaryApiKey: undefined,
1178 }))
1179
1180 // Clear memo cache
1181 getApiKeyFromConfigOrMacOSKeychain.cache.clear?.()
1182 clearLegacyApiKeyPrefetch()
1183}
1184
1185async function maybeRemoveApiKeyFromMacOSKeychain(): Promise<void> {
1186 try {

Callers 1

performLogoutFunction · 0.85

Calls 4

saveGlobalConfigFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected