mirror of
https://github.com/penpot/penpot.git
synced 2026-09-12 23:19:28 +00:00
🐛 Fix unexpected exception on logout handler.
This commit is contained in:
parent
9319520043
commit
9ec90c8bd9
@ -74,13 +74,13 @@
|
|||||||
|
|
||||||
(defn logout-handler
|
(defn logout-handler
|
||||||
[req]
|
[req]
|
||||||
(let [token (get-in req [:cookies "auth-token"])
|
(some-> (get-in req [:cookies "auth-token"])
|
||||||
token (uuid/from-string token)]
|
(uuid/from-string)
|
||||||
(-> (session/delete token)
|
(session/delete)
|
||||||
(p/then' (fn [token]
|
(p/then' (fn [token]
|
||||||
{:status 204
|
{:status 204
|
||||||
:cookies {"auth-token" nil}
|
:cookies {"auth-token" nil}
|
||||||
:body ""})))))
|
:body ""}))))
|
||||||
|
|
||||||
(defn echo-handler
|
(defn echo-handler
|
||||||
[req]
|
[req]
|
||||||
|
|||||||
@ -48,7 +48,7 @@
|
|||||||
[handler]
|
[handler]
|
||||||
(fn [request]
|
(fn [request]
|
||||||
(let [token (parse-token request)]
|
(let [token (parse-token request)]
|
||||||
(-> (retrieve token)
|
(-> (p/do! (retrieve token))
|
||||||
(p/then (fn [profile-id]
|
(p/then (fn [profile-id]
|
||||||
(if profile-id
|
(if profile-id
|
||||||
(handler (assoc request :profile-id profile-id))
|
(handler (assoc request :profile-id profile-id))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user