fixes, adding renames.
This commit is contained in:
@@ -9,6 +9,14 @@
|
||||
(def google-client-id "264081895820-0nndcfo3pbtqf30sro82vgq5r27h8736.apps.googleusercontent.com")
|
||||
(def google-client-secret "OC-WemHurPXYpuIw5cT-B90g")
|
||||
|
||||
(defn make-api-token []
|
||||
(jwt/sign {:user "API"
|
||||
:exp (time/plus (time/now) (time/days 700))
|
||||
:user/role "admin"
|
||||
:user/name "API"}
|
||||
(:jwt-secret env)
|
||||
{:alg :hs512}))
|
||||
|
||||
(defroutes routes
|
||||
(GET "/oauth" {{:strs [code]} :query-params :keys [scheme] :as r {:strs [host]} :headers}
|
||||
(try
|
||||
@@ -37,14 +45,14 @@
|
||||
;; TODO - these namespaces are not being transmitted/deserialized properly
|
||||
(if (and token user)
|
||||
{:status 301
|
||||
:headers {"Location" (str "/?jwt=" (jwt/sign {:user (:name profile)
|
||||
:exp (time/plus (time/now) (time/days 7))
|
||||
:user/clients (map (fn [c]
|
||||
(dissoc c :client/bank-accounts )
|
||||
)
|
||||
(:user/clients user))
|
||||
:user/role (name (:user/role user))
|
||||
:user/name (:name profile)}
|
||||
:headers {"Location" (str "/?jwt=" (jwt/sign (doto {:user (:name profile)
|
||||
:exp (time/plus (time/now) (time/days 7))
|
||||
:user/clients (map (fn [c]
|
||||
(dissoc c :client/bank-accounts ))
|
||||
(:user/clients user))
|
||||
:user/role (name (:user/role user))
|
||||
:user/name (:name profile)}
|
||||
println)
|
||||
(:jwt-secret env)
|
||||
{:alg :hs512}))}}
|
||||
{:status 401
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
(assert-admin identity)
|
||||
(let [[transactions] (d-transactions/get-graphql {:client-code (query-params "client-code")
|
||||
#_#_:original-id (Integer/parseInt (query-params "original"))
|
||||
:limit Integer/MAX_VALUE})
|
||||
:count Integer/MAX_VALUE})
|
||||
]
|
||||
(map (comp ->graphql (fn [i]
|
||||
(-> i
|
||||
|
||||
Reference in New Issue
Block a user