liberator

kwladyka 2019-01-15T15:36:38.005300Z

Can I run handle-ok instead of handle-created for POST? Especially about auth operations like login / logout.

kwladyka 2019-01-15T16:21:46.006Z

: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