()
| 1242 | } |
| 1243 | |
| 1244 | export async function removeApiKey(): Promise<void> { |
| 1245 | await maybeRemoveApiKeyFromMacOSKeychain() |
| 1246 | |
| 1247 | // Also remove from config instead of returning early, for older clients |
| 1248 | // that set keys before we supported keychain. |
| 1249 | saveGlobalConfig(current => ({ |
| 1250 | ...current, |
| 1251 | primaryApiKey: undefined, |
| 1252 | })) |
| 1253 | |
| 1254 | // Clear memo cache |
| 1255 | getApiKeyFromConfigOrMacOSKeychain.cache.clear?.() |
| 1256 | clearLegacyApiKeyPrefetch() |
| 1257 | } |
| 1258 | |
| 1259 | async function maybeRemoveApiKeyFromMacOSKeychain(): Promise<void> { |
| 1260 | try { |
no test coverage detected