Fork me on GitHub
Jenny Kwan00:01:27

Hey everyone. Sorry for the n00b question. I'm not front-end at all and have invested literally no time into understanding the re-frame loop. I just have a Chestnut templated application with re-frame that I'm trying to add a file upload form into. I'm sure I'm doing it wrong since I'm not dispatching any events - the form action is a direct POST - but in any case, my immediate issue is that I have no idea how to acquire and inject a CSRF token control into the form. I haven't had luck finding examples online, and definitely none with a walkthrough as to exactly what needs touching. Halp!


chestnut should have a way of putting the CSRF token on the page

Jenny Kwan00:01:16

OK. I can find nothing but I'll reach out on Clojureverse.


so you'll want to put that on the page. you'll probably want to parse it so that you can put the token in a global JS var


then, your app can read the CSRF token from the global var and put it in the form

Drew Verlee01:01:21

So there is no order in a effects map. But then why would i obverse the same event order most (95%) of the time? shouldn't it be a even distribution? maybe my experiment if flawed?


> no order in an effects map what do you mean by this? the order in which the effects occur?


@drewverlee the order in which effects are processed is not guaranteed so you should not rely on it. Even if you see a pattern.

Jenny Kwan05:01:44

@lilactown The issue seems to be the inability of client-side cljs accessing the ring.middleware.anti-forgery vars.

Jenny Kwan05:01:56

Going to ask in #reagent. Thanks!