Hi

On Mon, Nov 12, 2012 at 9:23 PM, Thorsten Wilms <t...@freenet.de> wrote:

> On 11/12/2012 03:20 PM, Chas Emerick wrote:
>
>> Looks like you're not using the keyword-params middleware, which
>> Friend requires (among others).  Please check the last paragraph in
>> the 'Authentication' section here:
>>
>> https://github.com/cemerick/**friend/#authentication<https://github.com/cemerick/friend/#authentication>
>>
>> Once you add that, then the interactive-form middleware will pick up
>> the form data you're submitting.
>>
>
> I tried to make sense of that in wrapping my main handler in authenticate
> in wrap-keyword-params, later also adding wrap-session, wrap-params and
> wrap-nested params.
>
> I still get a redirect to http://localhost:8080/login?&**
> login_failed=Y&username=<http://localhost:8080/login?&login_failed=Y&username=>
>
> So please, how/where shall I *add* wrap-keyword-params (and the others?)
> exactly?

Here's how you wrap your application with middleware (root-routes is your
main routes:

(def app
      (-> #'root-routes
           (friend/authenticate …)
           (wrap-keyword-params)
           (wrap-params)
           …))

Now following your example you can
(web/start app)

note that the above set of middleware are just sample. I have no idea if
this is all you need. If you'll use the hiccup library you have a
'handler/site' function that includes many of the required middleware you
need for a website (you can also just check the documentation to see the
list of middleware it uses).

In order to learn more about middleware check the *middleware* section here:
https://github.com/ring-clojure/ring/wiki/Concepts

Also, the friend repository has a mock application you can check:
https://github.com/cemerick/friend/blob/master/test/test_friend/mock_app.clj

HTH
-- 
Haim

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to