Ok. That was late yesterday and the wrap choking might be due to me pasting in a string. Today I can rephrase: How do I nest the ring middleware to get oauth2 working? With this code
(let [settings (-> site-defaults
(assoc-in [:session :cookie-attrs :same-site] :lax))]
(run-jetty
(wrap-oauth2 (wrap-params (wrap-defaults handler settings)) authmap)
{:port 3000}))
ring-oauth2/wrap-oauth2 receives the request with :query-string
set but no :params
. So in ring-oauth2/get-access-token sends a request to the google Server with code
set to nil
.@magra try putting wrap-params to the outermost level. (using threading macro put it as the last middleware in your run-jetty
)
this is the source for wrap-params:
(fn [request]
(handler (params-request request options))))
you can see that it makes params available to the handler it wraps@jumar thanks!!! That solves the params problem!
Now I get a state mismatch
😉
@magra did you figure it out 😄?