Questions tagged [lib-noir]

lib-noir is a set of utilities and helpers for building ring apps.

lib-noir is a set of utilities and helpers for building ring apps.

https://github.com/noir-clojure/lib-noir

5 questions
1
vote
0 answers

Why am I getting the java.lang.Boolean cannot be cast to clojure.lang.IFn error while validating fields in Clojure?

This is the validation function , vali is noir.validation: (defn valid? [name description] (vali/rule (vali/has-value? name) [:name "Name is nil"]) (vali/rule (vali/has-value? description) [:description…
1
vote
1 answer

How to save a user in noir session in a compojure web project?

I have to save a username in a session and I can't seem to make it work. This is my code (sesh is noir session): (defn set-loggedin [username password] (do (sesh/put! :username (:user username)) (sesh/put! :password (:pass password)))) (defn…
0
votes
1 answer

Why is username not saved in noir session in Clojure project?

This is how I save it during login: (defn set-loggedin [username] (sesh/put! :username username)) (defn login-handler [username password] (let [user (datab/login username password)] (if (empty? user) (view/login-form "Wrong password.") (do …
0
votes
1 answer

Weird session management bug when mixing ring's `wrap-defaults`' and lib-noir's `wrap-noir-session`

I have a ring webapp that uses noir.session as follows: (def app (-> app-routes (session/wrap-noir-session) (wrap-defaults site-defaults))) ; both from ring.middleware.defaults However, it seems like session variables are lost…
blubb
  • 9,510
  • 3
  • 40
  • 82
0
votes
1 answer

How do I add webjars resources to lib-noir's app-handler?

How do I add webjars resources to lib-noir's app-handler? I used to do this only using Ring like this: (def app (-> handler (wrap-resource "public") (wrap-resource "/META-INF/resources") ;;resources from webjars )) Now I'm…
Michiel Borkent
  • 34,228
  • 15
  • 86
  • 149