Should (mostly) fix the new history page.
This commit is contained in:
@@ -39,22 +39,25 @@
|
||||
:user/provider-id (:id profile)
|
||||
:user/role :user-role/none
|
||||
:user/name (:name profile)})
|
||||
auth {:user (:name profile)
|
||||
:exp (time/plus (time/now) (time/days 30))
|
||||
:user/clients (map (fn [c]
|
||||
(select-keys c [:client/code :db/id :client/name :client/locations]))
|
||||
(:user/clients user))
|
||||
:user/role (name (:user/role user))
|
||||
:user/name (:name profile)}
|
||||
]
|
||||
(log/info "authenticated as user" user)
|
||||
;; TODO - these namespaces are not being transmitted/deserialized properly
|
||||
|
||||
(if (and token user)
|
||||
(let [jwt (jwt/sign {:user (:name profile)
|
||||
:exp (time/plus (time/now) (time/days 30))
|
||||
:user/clients (map (fn [c]
|
||||
(select-keys c [:client/code :db/id :client/name :client/locations]))
|
||||
(:user/clients user))
|
||||
:user/role (name (:user/role user))
|
||||
:user/name (:name profile)}
|
||||
(let [jwt (jwt/sign auth
|
||||
(:jwt-secret env)
|
||||
{:alg :hs512})]
|
||||
|
||||
{:status 301
|
||||
:headers {"Location" (str "/?jwt=" jwt)}})
|
||||
:headers {"Location" (str "/?jwt=" jwt)}
|
||||
:session {:identity auth}})
|
||||
{:status 401
|
||||
:body "Couldn't authenticate"}))
|
||||
(catch Exception e
|
||||
|
||||
Reference in New Issue
Block a user