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

Function removeApiKey

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

Source from the content-addressed store, hash-verified

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

Callers 1

performLogoutFunction · 0.85

Calls 4

saveGlobalConfigFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected