diff --git a/backend/src/uxbox/http/handlers.clj b/backend/src/uxbox/http/handlers.clj index e5444cdf7..eb83d69df 100644 --- a/backend/src/uxbox/http/handlers.clj +++ b/backend/src/uxbox/http/handlers.clj @@ -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] diff --git a/backend/src/uxbox/http/session.clj b/backend/src/uxbox/http/session.clj index 7927baa57..0c3af0560 100644 --- a/backend/src/uxbox/http/session.clj +++ b/backend/src/uxbox/http/session.clj @@ -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))