opencode-studio-server 1.0.9 → 1.0.10

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.
Files changed (2) hide show
  1. package/index.js +3 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -989,6 +989,7 @@ function setActiveProfile(provider, profileName) {
989
989
  saveStudioConfig(studioConfig);
990
990
  }
991
991
 
992
+ function verifyActiveProfile(p, n, c) { if (!n || !c) return false; const d = loadAuthProfile(p, n); if (!d) return false; return JSON.stringify(d) === JSON.stringify(c); }
992
993
  app.get('/api/auth/profiles', (req, res) => {
993
994
  ensureAuthProfilesDir();
994
995
  const activeProfiles = getActiveProfiles();
@@ -1000,7 +1001,7 @@ app.get('/api/auth/profiles', (req, res) => {
1000
1001
  const providerProfiles = listAuthProfiles(provider);
1001
1002
  profiles[provider] = {
1002
1003
  profiles: providerProfiles,
1003
- active: activeProfiles[provider] || null,
1004
+ active: (activeProfiles[provider] && verifyActiveProfile(provider, activeProfiles[provider], authConfig[provider])) ? activeProfiles[provider] : null,
1004
1005
  hasCurrentAuth: !!authConfig[provider],
1005
1006
  };
1006
1007
  });
@@ -1016,7 +1017,7 @@ app.get('/api/auth/profiles/:provider', (req, res) => {
1016
1017
 
1017
1018
  res.json({
1018
1019
  profiles: providerProfiles,
1019
- active: activeProfiles[provider] || null,
1020
+ active: (activeProfiles[provider] && verifyActiveProfile(provider, activeProfiles[provider], authConfig[provider])) ? activeProfiles[provider] : null,
1020
1021
  hasCurrentAuth: !!authConfig[provider],
1021
1022
  });
1022
1023
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-studio-server",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Backend server for OpenCode Studio - manages opencode configurations",
5
5
  "main": "index.js",
6
6
  "bin": {