I was trying to implement CSRF protection as described in the documentation and received a compiler error Caused by: java.lang.RuntimeException: Unable to resolve symbol: add-tag! in this context
Error was resolved (with the assistance of a very helpful fellow Clojure user) by calling
As relative new comer to clojure, I was stumped for quite a bit. The project I was working on was created with the
lein new luminus [projectname] +h2
template. I think updating the documentation to have those dependencies explicitly declared might make things a bit clearer to people like me who are jumping around the docs after the tutorial.
ps
Really grateful for this framework / your book-- both have been very helpful to me.
I was trying to implement CSRF protection as described in the documentation and received a compiler error
Caused by: java.lang.RuntimeException: Unable to resolve symbol: add-tag! in this context
Error was resolved (with the assistance of a very helpful fellow Clojure user) by calling
(parser/add-tag! :csrf-token (fn [_ _] (anti-forgery-field)))
instead of
(add-tag! :csrf-token (fn [_ _] (anti-forgery-field)))
as described in the docs. After that I received another compiler error
Caused by: java.lang.RuntimeException: Unable to resolve symbol: anti-forgery-field in this context
which was resolved by adding
[ring.util.anti-forgery :refer [anti-forgery-field]]
to the ns decl.
As relative new comer to clojure, I was stumped for quite a bit. The project I was working on was created with the
lein new luminus [projectname] +h2
template. I think updating the documentation to have those dependencies explicitly declared might make things a bit clearer to people like me who are jumping around the docs after the tutorial.
ps Really grateful for this framework / your book-- both have been very helpful to me.