opencode-studio-server 1.12.1 → 1.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +10 -12
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1636,14 +1636,18 @@ app.delete('/api/auth/profiles/:provider/:name', (req, res) => {
|
|
|
1636
1636
|
if (studio.activeProfiles && studio.activeProfiles[provider] === name) {
|
|
1637
1637
|
delete studio.activeProfiles[provider];
|
|
1638
1638
|
saveStudioConfig(studio);
|
|
1639
|
+
}
|
|
1639
1640
|
|
|
1640
|
-
|
|
1641
|
+
const authCfg = loadAuthConfig() || {};
|
|
1642
|
+
if (provider === 'google' && authCfg.google?.email === name) {
|
|
1643
|
+
delete authCfg.google;
|
|
1644
|
+
delete authCfg['google.antigravity'];
|
|
1645
|
+
delete authCfg['google.gemini'];
|
|
1646
|
+
const cp = getConfigPath();
|
|
1647
|
+
const ap = path.join(path.dirname(cp), 'auth.json');
|
|
1648
|
+
atomicWriteFileSync(ap, JSON.stringify(authCfg, null, 2));
|
|
1649
|
+
} else if (authCfg[provider]) {
|
|
1641
1650
|
delete authCfg[provider];
|
|
1642
|
-
if (provider === 'google') {
|
|
1643
|
-
const key = 'google.antigravity';
|
|
1644
|
-
delete authCfg.google;
|
|
1645
|
-
delete authCfg[key];
|
|
1646
|
-
}
|
|
1647
1651
|
const cp = getConfigPath();
|
|
1648
1652
|
const ap = path.join(path.dirname(cp), 'auth.json');
|
|
1649
1653
|
atomicWriteFileSync(ap, JSON.stringify(authCfg, null, 2));
|
|
@@ -1918,12 +1922,6 @@ function syncAntigravityPool() {
|
|
|
1918
1922
|
const profileDir = path.join(AUTH_PROFILES_DIR, namespace);
|
|
1919
1923
|
|
|
1920
1924
|
if (!accounts.length) {
|
|
1921
|
-
if (fs.existsSync(profileDir)) fs.rmSync(profileDir, { recursive: true, force: true });
|
|
1922
|
-
const metadata = loadPoolMetadata();
|
|
1923
|
-
if (metadata[namespace]) {
|
|
1924
|
-
delete metadata[namespace];
|
|
1925
|
-
savePoolMetadata(metadata);
|
|
1926
|
-
}
|
|
1927
1925
|
return;
|
|
1928
1926
|
}
|
|
1929
1927
|
|