qwen-opencode-provider 2.0.2 → 2.0.3
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 +12 -10
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -67,17 +67,19 @@ function readApiKeyFromAuth() {
|
|
|
67
67
|
|
|
68
68
|
log(`[Auth] Auth file contents keys: ${Object.keys(auth).join(', ')}`);
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
log(`[Auth]
|
|
70
|
+
// Try both apiKey and key fields
|
|
71
|
+
const providerAuth = auth[PROVIDER_ID];
|
|
72
|
+
if (providerAuth) {
|
|
73
|
+
const apiKey = providerAuth.apiKey || providerAuth.key || providerAuth.token || null;
|
|
74
|
+
if (apiKey) {
|
|
75
|
+
const keyPreview = apiKey.substring(0, 20) + '...';
|
|
76
|
+
log(`[Auth] Found API key for ${PROVIDER_ID}: ${keyPreview}`);
|
|
77
|
+
return apiKey;
|
|
78
|
+
} else {
|
|
79
|
+
log(`[Auth] Provider exists but no key field: ${JSON.stringify(providerAuth)}`);
|
|
80
80
|
}
|
|
81
|
+
} else {
|
|
82
|
+
log(`[Auth] No provider found for ${PROVIDER_ID}`);
|
|
81
83
|
}
|
|
82
84
|
} else {
|
|
83
85
|
log(`[Auth] Auth file does not exist`);
|