I am not sure if this is a Ring problem or a Compojure problem. I set
up my app as you see below. However, when I go to "/", I have the
function do this:
(prn (apply str request))
and I see a great deal of information printed out at the terminal, but
no session is set. What am I doing wrong? How do I initiate the
session?
(defroutes app-routes
(GET "/" request (index request))
(GET "/search-results" request (search-results request))
(GET "/account" request (friend/authorize #{::user} (enlive/emit*
(enlive/html-resource "templates/account.html"))))
(GET "/admin" request (friend/authorize #{::admin} (enlive/emit*
(enlive/html-resource "templates/admin.html"))))
(friend/logout (ANY "/logout" request (ring.util.response/redirect
"/"))))
(GET "/login" request "Login page.")
(GET "/schema" request (apply str (yaml/generate-string
@interactions))
(route/not-found "Page not found"))
(def app
(-> app-routes
(friend/authenticate {:credential-fn (partial creds/bcrypt-
credential-fn (:users interactions))
:workflows [(workflows/interactive-
form)]})
(wrap-resource "public")
(wrap-params)
(wrap-session {:cookie-name "timeout-discovery-session" :store
(cookie-store) :cookie-attrs {:max-age 10000000 }})))
(defn -main [& args]
(let [port (Integer/parseInt (first args))]
(try
(run-jetty #'app {:port (or port 8080) :join? false})
(catch Exception e (debug/print-error-info e)))))
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en