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

Function removeApiKey

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

Source from the content-addressed store, hash-verified

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

Callers 1

performLogoutFunction · 0.85

Calls 4

saveGlobalConfigFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected