()
| 1164 | } |
| 1165 | |
| 1166 | export 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 | |
| 1181 | async function maybeRemoveApiKeyFromMacOSKeychain(): Promise<void> { |
| 1182 | try { |
no test coverage detected