🎉 Add rpc methods for access tokens

This commit is contained in:
Andrey Antukh 2023-01-17 10:47:05 +01:00
parent a79d2cf899
commit bca98f91e4
2 changed files with 30 additions and 1 deletions

View file

@ -8,6 +8,7 @@
(:require
[app.auth]
[app.common.data :as d]
[app.common.exceptions :as ex]
[app.common.flags :as flags]
[app.common.pages :as cp]
[app.common.pprint :as pp]
@ -320,6 +321,11 @@
(defn command!
[{:keys [::type] :as data}]
(let [method-fn (get-in *system* [:app.rpc/methods :commands type])]
(when-not method-fn
(ex/raise :type :assertion
:code :rpc-method-not-found
:hint (str/ffmt "rpc method '%' not found" (name type))))
;; (app.common.pprint/pprint (:app.rpc/methods *system*))
(try-on! (method-fn (-> data
(dissoc ::type)