reimplemented security

This commit is contained in:
Bryce Covert
2019-01-16 21:30:39 -08:00
parent 24b82802a8
commit 583752d740
27 changed files with 52 additions and 61 deletions

View File

@@ -39,7 +39,10 @@
{:status 301
:headers {"Location" (str "/?jwt=" (jwt/sign {:user (:name profile)
:exp (time/plus (time/now) (time/days 7))
:user/clients (:user/clients user)
:user/clients (map (fn [c]
(dissoc c :client/bank-accounts )
)
(:user/clients user))
:user/role (name (:user/role user))
:user/name (:name profile)}
(:jwt-secret env)

View File

@@ -11,7 +11,7 @@
(wrap-routes
(context "/graphql" []
(GET "/" {:keys [query-params] :as r}
(when (= "none" (:role (:identity r)))
(when (= "none" (:user/role (:identity r)))
(throw-unauthorized))
(try

View File

@@ -165,6 +165,7 @@
(map (parse-or-error :client-id parse-client-id))
(map (parse-or-error :date parse-date)))
error-rows (filter :errors rows)
_ (println "importing raw transactions" rows)
raw-transactions (vec (->> rows
(filter #(not (seq (:errors %))) )