chenbhao commited on
Commit
64efe5d
·
1 Parent(s): d057690

fix: Not logged in . Run /login in opencode

Browse files
Files changed (1) hide show
  1. src/hooks/useApiKeyVerification.ts +18 -0
src/hooks/useApiKeyVerification.ts CHANGED
@@ -63,6 +63,12 @@ export function useApiKeyVerification(): ApiKeyVerificationResult {
63
  return 'missing'
64
  }
65
 
 
 
 
 
 
 
66
  // Anthropic authentication
67
  if (!isAnthropicAuthEnabled() || isClaudeAISubscriber()) {
68
  return 'valid'
@@ -131,6 +137,12 @@ export function useApiKeyVerification(): ApiKeyVerificationResult {
131
  return
132
  }
133
 
 
 
 
 
 
 
134
  // Anthropic authentication
135
  if (!isAnthropicAuthEnabled() || isClaudeAISubscriber()) {
136
  setStatus('valid')
@@ -210,6 +222,12 @@ export function useApiKeyVerification(): ApiKeyVerificationResult {
210
  return
211
  }
212
 
 
 
 
 
 
 
213
  // Anthropic authentication
214
  if (!isAnthropicAuthEnabled() || isClaudeAISubscriber()) {
215
  setStatus('valid')
 
63
  return 'missing'
64
  }
65
 
66
+ // Check OpenCode Zen authentication
67
+ // OpenCode Zen uses free models by default, no API key required
68
+ if (authProvider === 'opencode') {
69
+ return 'valid'
70
+ }
71
+
72
  // Anthropic authentication
73
  if (!isAnthropicAuthEnabled() || isClaudeAISubscriber()) {
74
  return 'valid'
 
137
  return
138
  }
139
 
140
+ // Check OpenCode Zen authentication
141
+ if (authProvider === 'opencode') {
142
+ setStatus('valid')
143
+ return
144
+ }
145
+
146
  // Anthropic authentication
147
  if (!isAnthropicAuthEnabled() || isClaudeAISubscriber()) {
148
  setStatus('valid')
 
222
  return
223
  }
224
 
225
+ // Check OpenCode Zen authentication
226
+ if (authProvider === 'opencode') {
227
+ setStatus('valid')
228
+ return
229
+ }
230
+
231
  // Anthropic authentication
232
  if (!isAnthropicAuthEnabled() || isClaudeAISubscriber()) {
233
  setStatus('valid')