mirror of
https://github.com/penpot/penpot.git
synced 2025-05-12 04:16:37 +02:00
🐛 Fix unexpected exception on logout handler.
This commit is contained in:
parent
9319520043
commit
9ec90c8bd9
2 changed files with 8 additions and 8 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue