()
| 1218 | } |
| 1219 | |
| 1220 | export async function removeApiKey(): Promise<void> { |
| 1221 | await maybeRemoveApiKeyFromMacOSKeychain() |
| 1222 | |
| 1223 | // Also remove from config instead of returning early, for older clients |
| 1224 | // that set keys before we supported keychain. |
| 1225 | saveGlobalConfig(current => ({ |
| 1226 | ...current, |
| 1227 | primaryApiKey: undefined, |
| 1228 | })) |
| 1229 | |
| 1230 | // Clear memo cache |
| 1231 | getApiKeyFromConfigOrMacOSKeychain.cache.clear?.() |
| 1232 | clearLegacyApiKeyPrefetch() |
| 1233 | } |
| 1234 | |
| 1235 | async function maybeRemoveApiKeyFromMacOSKeychain(): Promise<void> { |
| 1236 | try { |
no test coverage detected