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