Fork me on GitHub
#reitit
<
2019-01-16
>
datran02:01:55

hello, I'm trying to get some basic session authentication working with buddy, and I'm having trouble with the wrap-session and wrap-authentication middleware pieces

datran02:01:20

here's a simplified version of what I'm looking at:

(def rei
  (ring/ring-handler
   (ring/router
    [["/" {:get home}]
     ["/login" {:get login
                :post login-authenticate}]
     ["/logout" {:get logout}]
     ["/user" {:get user}]]
    {:data {:middleware [wrap-auth
                         wrap-params
                         wrap-session]}})))

datran02:01:13

wrap-session is adding the :session keyword, but it doesn't seem to be adding the :session/key value

valerauko16:01:07

is it supposed to do that?

datran16:01:29

I decided to just write my own auth middleware, rather than use the ring-session and buddy-auth stuff

datran16:01:44

it just wasn't worth the time investment to figure out something that should be simple

ikitommi19:01:41

@datran wrote an issue about that, hopefully explains why it doesn’t work (and how to make it work): https://github.com/metosin/reitit/issues/205

datran19:01:04

Thanks! That's a good summary of the issue, now I understand what I was seeing.