Tweak for poke
This commit is contained in:
@@ -62,9 +62,7 @@
|
||||
(select-keys c [:client/code :db/id :client/locations]))))))]
|
||||
|
||||
(when (and user oauth-token)
|
||||
(jwt/sign auth
|
||||
(:jwt-secret env)
|
||||
{:alg :hs512}))))
|
||||
auth)))
|
||||
|
||||
(defn oauth [{{:strs [code state]} :query-params {:strs [host]} :headers :as request}]
|
||||
(try
|
||||
@@ -93,8 +91,11 @@
|
||||
|
||||
(if-let [jwt (user->jwt user token)]
|
||||
{:status 301
|
||||
:headers {"Location" (str (or (not-empty state) "/") "?jwt=" jwt)}
|
||||
:session {:identity (dissoc auth :exp)}}
|
||||
:headers {"Location" (str (or (not-empty state) "/") "?jwt="
|
||||
(jwt/sign jwt
|
||||
(:jwt-secret env)
|
||||
{:alg :hs512}))}
|
||||
:session {:identity (dissoc jwt :exp)}}
|
||||
{:status 401
|
||||
:body "Couldn't authenticate"}))
|
||||
(catch Exception e
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
(let [variables (some-> (query-params "variables")
|
||||
edn/read-string)
|
||||
body (some-> r :body slurp)]
|
||||
(println "CLIENTS" clients)
|
||||
|
||||
{:status 200
|
||||
:body (pr-str (ql/query (:identity r) (if (= request-method :get) (query-params "query") body) (assoc variables
|
||||
|
||||
Reference in New Issue
Block a user