I'm posting this because right now someone is scrounging the internet for 3
hours to find this simple solution, I hope that they find this post sooner
rather than later, and can move on to their next project!
*TLDR*
Goto /src/clj/myapp/server.clj
Edit "3000" to be whatever you want:
(defn -m
So when I use cljs-ajax to post to my APP I get an Invalid anti-forgery
token error.
Despite there being dozens of posts about this issue, none of them have a
solution that seems to work if you started your project using this:
lein new reagent myapp
The first post that comes up as a "solution
The "use" function is a deprecated shortcut for "require" and "refer". I
can see why it would be confusing, so I'll change the examples on the
ring-anti-forgery site.
Packages can contain many namespaces, so in general you won't find package
names matching up precisely to the namespace or namespac
Wow, thank you! This makes a lot of sense, it sounds like I really do not
need CSRF protection.. I'm just adding complexity there..
I think my key mess up here was getting my client side / server side code
mixed up in my head. I am really enjoying using ClojureScript and Clojure
side by side, b
I think this is something a lot of web developers take for granted, so
perhaps it isn't mentioned as much as it could be.
The usual convention in Linux environments is to set the port via the PORT
environment variable. So on the command line it would be:
PORT=3001 java -jar yourapp.jar
That's
Hi Herwig,
I got what my problem is. If I use the keyword
(zx/tag= ::can/mqMessageHeader)
everything works just fine. But my code is using a string representation of
the tag and using keyword to convert it to a keyword
(zx/tag= (keyword ":can/mqMessageHeader")))
and this for some reaso
Okay, armed with the new clarity, I felt embolden to tackle this once more.
Here's the next steps for those trying to tack CSRF protection onto a
Reagent project created with lein new reagent.
In handler.clj - you'll add the ring.middleware.anti-forgery and refer to
*anti-forgery-token*
(ns m
:-O
That just blew my mind - Thanks! :)
On Friday, December 23, 2016 at 11:01:28 AM UTC-5, James Reeves wrote:
>
> I think this is something a lot of web developers take for granted, so
> perhaps it isn't mentioned as much as it could be.
>
> The usual convention in Linux environments is to set
>
> modern setup in Emacs
>
I generally recommend https://github.com/bbatsov/prelude for newcomers to
emacs, especially if you are interested in Clojure development. As for the
repl, Prelude comes with CIDER out of the box and the docs for that are
quite good: http://cider.readthedocs.io/en/la
Another way of introducing the anti-forgery token is to bind it to a
javascript variable.
[:script "var antiForgeryToken = " (pr-str *anti-forgery-token*)]
In ClojureScript, you can then access the token with js/antiForgeryToken.
The Ring-Defaults library exists to provide a way of applying co
Instaparse is a library for generating parsers from context-free grammars.
https://github.com/engelberg/instaparse
The big news for this release is that Alex Engelberg has combined the
Clojure version with the Clojurescript version of instaparse (initiated by
Lucas Bradstreet in 2014) so that movi
11 matches
Mail list logo