Closed ccfontes closed 11 years ago
There's been a breaking change regarding the access rules handling in 0.6.2. The change is documented here.
Using the 0.6.2 API the handler should look as follows:
(def app
(noir.util.middleware/app-handler [private-routes routes]
:middleware [wrap-bootstrap-resources wrap-exception]
:access-rules
[{:redirect (fn [request] "/login") ;;this could also be just a string "/login" if fn isn't doing anything
:rules [private-pages]}]))
Also, the restricted
macro now wraps the handler instead of the route:
(GET "/foo" [] (restricted foo-handler))
This was introduced to make it play nicer with things like context
from Compojure.
Finally, the access-rule
macro has been deprecated in favor of specifying rule groups directly in the :access-rules
key.
I get the exception below either with 0.6.1 or 0.6.2, but 0.6.0 is fine. Running compojure 1.1.5 and clojure 1.4.0.
Also, my app handler:
Exception: