🐛 Fix cookie elimination issues.

This commit is contained in:
Andrey Antukh 2019-12-11 12:14:39 +01:00
parent 449ca770c1
commit 4dad6bef40
2 changed files with 4 additions and 2 deletions

View file

@ -55,7 +55,7 @@
(-> (session/delete token)
(p/then' (fn [token]
{:status 204
:cookies {"auth-token" {:value nil}}
:cookies {"auth-token" nil}
:body ""})))))
(defn register-handler

View file

@ -55,7 +55,9 @@
^HttpServerResponse res (get-in data [:request ::vh/response])]
(when (map? cookies)
(vu/doseq [[key val] cookies]
(.addCookie res (build-cookie key val))))
(if (nil? val)
(.removeCookie res key)
(.addCookie res (build-cookie key val)))))
data))})
;; --- Params