Fork me on GitHub
Ian Fernandez03:12:05

I'm having problems using Sente

Ian Fernandez03:12:25

Client's Ring request doesn't have a client id. Does your server have the necessary keyword Ring middleware (`wrap-params` & `wrap-keyword-params`)?%
for this request:
curl --include \                             
     --no-buffer \
     --header "Connection: Upgrade" \
     --header "Upgrade: websocket" \
     --header "Host: " \
     --header "Origin: " \
     --header "Sec-WebSocket-Version: 13" \

Ian Fernandez03:12:06

this is my Routes on Router:

[ ["/healthcheck"
   {:name :healthcheck,
    {:summary "Returns 200 and some server info if server is OK",
     (fn [_]
       {:status 200
        :body   {:status "OK"}})},
    {:no-doc true,
     :handler reitit.ring/default-options-handler}}]
  {:no-doc true, :braveno.common.oidc.ring/public true}
     :swagger {:info {:title "Braveno v2 API"}}}}]
    {:handler (swagger-ui/create-swagger-ui-handler
                {:url    "/api/v2/swagger.json"
                 :config {:validatorUrl nil}})}}]]
  {:name :chanel-endpoint,
   {:summary "GET websocket",
    (fn [req]
      (ring-ajax-get-or-ws-handshake req))},
   {:summary "POST websocket",
    (fn [req]
      (ring-ajax-post req))},
   {:no-doc true,

Ian Fernandez03:12:02

these are mine middlewares:

{:data     {:coercion   rs/coercion
            :middleware [middleware.cors/wrap-access-control
            :muuntaja   m/instance
            :compile    rc/compile-request-coercers}
 :validate rrs/validate}

Ian Fernandez03:12:20

Which would be the problem?

Ian Fernandez03:12:02

rrmp/parameters-middleware would be enough for having (`wrap-params` & wrap-keyword-params) ???

Noah Bogart03:12:00

this is a sente question, not a reitit question, but i think i can help

Noah Bogart03:12:30

the url of your curl request doesn’t have the client-id as a query string: /chsk?client-id=f93ccd7d-0897-4afe-aaf0-a21c024917d2&csrf-token=Xr74j+V5bRRlrnZ25r4M6S9Px6942RjYRFdiUU/tnzQcW+s4SU1OFceIHfSTGXe6EZADx+fKN6MT6omU

👍 1
Noah Bogart03:12:02

there’s an example from my app, which includes the csrf token as a query string as well

Ian Fernandez04:12:18

Where is the example? :)

Noah Bogart05:12:52

oh, you thought i meant like code, no, i’m just referring to the previous message