Hello, I am trying to get a login form to work in Compojure. I had
originally written this app in Noir, but now I'm trying to move it off of
Noir. I am now using Lib-Noir and the (noir.session) namespace doesn't seem
to be working the same way as Noir. I'm now confused.
The error, as mentioned in the title:
java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to
clojure.lang.Atom
Here is the code that appears to be getting mucked up:
(defn do-login [handle passwd]
(let [tuser (select db/allusers
(fields :username :password :usertype)
(where {:username "newguy"}))]
(if (crypt/compare "password"
(let [[{pwd :password}] tuser]
pwd))
;; error on this line:
(do (sesh/put! :uname handle)
(response/redirect "/"))
(response/redirect "/"))))
and the route:
(GET "/account-login" [] (homes/login-page))
(POST "/account-login" {{:strs [handle passwd]} :params}
(log/do-login handle passwd))
--
--
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
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.