noir-clojure / lib-noir

A set of libraries for ring apps, including stateful sessions.
Eclipse Public License 1.0
481 stars 47 forks source link

wrap-access-rules and dynamic :redirect #57

Closed vaughnd closed 11 years ago

vaughnd commented 11 years ago

Hi,

Can the :redirect option in noir.middleware/wrap-access-rules please be changed to allow a function as well as a string? I'd like add the failed auth url to the session so that users can be redirected to it once they've logged in.

Instead of {:redirect "/login"} I'd like to use {:redirect #(str "/login?redirect-to=" (:uri noir.request/request))}. Unless there's a cleaner way of doing this?

Regards, Vaughn