MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / removeApiKey

Function removeApiKey

source code/utils/auth.ts:1172–1185  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

performLogoutFunction · 0.85

Calls 4

saveGlobalConfigFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected