0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-10 00:58:26 -05:00

🐛 Fix unexpected exception on logout handler.

This commit is contained in:
Andrey Antukh 2020-03-02 10:08:54 +01:00
parent 9319520043
commit 9ec90c8bd9
2 changed files with 8 additions and 8 deletions

View file

@ -74,13 +74,13 @@
(defn logout-handler
[req]
(let [token (get-in req [:cookies "auth-token"])
token (uuid/from-string token)]
(-> (session/delete token)
(p/then' (fn [token]
{:status 204
:cookies {"auth-token" nil}
:body ""})))))
(some-> (get-in req [:cookies "auth-token"])
(uuid/from-string)
(session/delete)
(p/then' (fn [token]
{:status 204
:cookies {"auth-token" nil}
:body ""}))))
(defn echo-handler
[req]

View file

@ -48,7 +48,7 @@
[handler]
(fn [request]
(let [token (parse-token request)]
(-> (retrieve token)
(-> (p/do! (retrieve token))
(p/then (fn [profile-id]
(if profile-id
(handler (assoc request :profile-id profile-id))