fixes, adding renames.

This commit is contained in:
Bryce Covert
2019-02-01 16:58:11 -08:00
parent 3cb25ac057
commit f0fb70f193
8 changed files with 61 additions and 12 deletions

View File

@@ -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