Can I run handle-ok
instead of handle-created
for POST? Especially about auth operations like login / logout.
:handle-created (fn [{:keys [request] :as ctx}]
(let [{:keys [params]} request
{:keys [email password]} params]
(println "request" request)
(if-let [uuid (login email password)]
(ring-response {:status 200
:session {:uuid uuid}})
(ring-response {:status 401
:session nil}))))
Now I have this, but I feel a little weird with :handle-created