File tree Expand file tree Collapse file tree 7 files changed +13
-10
lines changed
Expand file tree Collapse file tree 7 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 22
33## Unreleased
44
5+ - Fix manual anthropic login to save credentials in global config instead of cache.
6+
57## 0.51.2
68
79- Minor log improvement of failed to start MCPs.
Original file line number Diff line number Diff line change 33 [cheshire.core :as json]
44 [clojure.java.io :as io]
55 [clojure.string :as string]
6+ [eca.config :as config]
67 [eca.features.login :as f.login]
78 [eca.llm-util :as llm-util]
89 [eca.logger :as logger]
328329
329330(defmethod f.login /login-step [" anthropic" :login/waiting-api-key ] [{:keys [db* input provider send-msg!] :as ctx}]
330331 (if (string/starts-with? input " sk-" )
331- (do ( swap! db* assoc-in [ :auth provider] { :step :login/done
332- :type :auth/token
333- :mode :manual
334- :api-key input} )
335- (f.login/login-done! ctx))
332+ (do
333+ ( config/update-global-config! { :providers { " anthropic " { :key input}}})
334+ ( swap! db* dissoc :auth provider)
335+ ( send-msg! ( format " API key and models saved to %s " ( .getCanonicalPath ( config/global-config-file ))) )
336+ (f.login/login-done! ctx))
336337 (send-msg! (format " Invalid API key '%s'" input))))
337338
338339(defmethod f.login /login-step [" anthropic" :login/renew-token ] [{:keys [db* provider] :as ctx}]
Original file line number Diff line number Diff line change 3030 {}
3131 (string/split input #"," ))
3232 :key api-key}}}))
33- (swap! db* assoc-in [ :auth provider] nil )
33+ (swap! db* dissoc :auth provider)
3434 (send-msg! (format " API key, url and models saved to %s" (.getCanonicalPath (config/global-config-file ))))
3535 (f.login/login-done! ctx))
Original file line number Diff line number Diff line change 2424 {}
2525 (string/split input #"," ))
2626 :key api-key}}}))
27- (swap! db* assoc-in [ :auth provider] nil )
27+ (swap! db* dissoc :auth provider)
2828 (send-msg! (format " API key and models saved to %s" (.getCanonicalPath (config/global-config-file ))))
2929 (f.login/login-done! ctx))
Original file line number Diff line number Diff line change 205205(defmethod f.login /login-step [" openai" :login/waiting-api-key ] [{:keys [input db* provider send-msg!] :as ctx}]
206206 (if (string/starts-with? input " sk-" )
207207 (do (config/update-global-config! {:providers {" openai" {:key input}}})
208- (swap! db* assoc-in [ :auth provider] nil )
208+ (swap! db* dissoc :auth provider)
209209 (send-msg! (str " API key saved in " (.getCanonicalPath (config/global-config-file ))))
210210
211211 (f.login/login-done! ctx :update-cache? false ))
Original file line number Diff line number Diff line change 2424 {}
2525 (string/split input #"," ))
2626 :key api-key}}}))
27- (swap! db* assoc-in [ :auth provider] nil )
27+ (swap! db* dissoc :auth provider)
2828 (send-msg! (format " API key and models saved to %s" (.getCanonicalPath (config/global-config-file ))))
2929 (f.login/login-done! ctx))
Original file line number Diff line number Diff line change 2424 {}
2525 (string/split input #"," ))
2626 :key api-key}}}))
27- (swap! db* assoc-in [ :auth provider] nil )
27+ (swap! db* dissoc :auth provider)
2828 (send-msg! (format " API key and models saved to %s" (.getCanonicalPath (config/global-config-file ))))
2929 (f.login/login-done! ctx))
You can’t perform that action at this time.
0 commit comments