opencode-studio-server 1.12.10 → 1.12.12
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 +3 -17
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1711,23 +1711,9 @@ app.put('/api/auth/profiles/:provider/:name', (req, res) => {
|
|
|
1711
1711
|
});
|
|
1712
1712
|
|
|
1713
1713
|
app.post('/api/auth/login', (req, res) => {
|
|
1714
|
-
let
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
const ALLOWED_PROVIDERS = [
|
|
1718
|
-
"", "google", "anthropic", "openai", "xai",
|
|
1719
|
-
"openrouter", "github-copilot", "gemini",
|
|
1720
|
-
"together", "mistral", "deepseek", "amazon-bedrock", "azure"
|
|
1721
|
-
];
|
|
1722
|
-
|
|
1723
|
-
if (provider && !ALLOWED_PROVIDERS.includes(provider)) {
|
|
1724
|
-
return res.status(400).json({ error: 'Invalid provider' });
|
|
1725
|
-
}
|
|
1726
|
-
|
|
1727
|
-
if (typeof provider !== 'string') provider = "";
|
|
1728
|
-
|
|
1729
|
-
let cmd = 'opencode auth login';
|
|
1730
|
-
if (provider) cmd += ` ${provider}`;
|
|
1714
|
+
// Always run generic `opencode auth login` - let CLI handle provider selection
|
|
1715
|
+
// This avoids bugs in CLI where specific providers (e.g. openai) fail with "fetch() URL is invalid"
|
|
1716
|
+
const cmd = 'opencode auth login';
|
|
1731
1717
|
|
|
1732
1718
|
const cp = getConfigPath();
|
|
1733
1719
|
const configDir = cp ? path.dirname(cp) : process.cwd();
|