This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-16
Channels
- # admin-announcements (2)
- # bangalore-clj (3)
- # beginners (15)
- # boot (303)
- # carry (18)
- # cider (7)
- # cljs-dev (222)
- # cljsrn (103)
- # clojure (196)
- # clojure-czech (2)
- # clojure-russia (69)
- # clojure-spec (21)
- # clojure-uk (48)
- # clojurescript (68)
- # cursive (18)
- # datomic (185)
- # events (1)
- # hoplon (2)
- # lambdaisland (1)
- # leiningen (1)
- # mount (10)
- # off-topic (1)
- # om (14)
- # onyx (154)
- # parinfer (1)
- # pedestal (3)
- # planck (5)
- # protorepl (9)
- # re-frame (17)
- # reagent (27)
- # ring (2)
- # specter (58)
- # test-check (1)
- # testing (7)
- # untangled (59)
- # yada (35)
@sandbags: Are you using this : https://github.com/ring-clojure/ring-defaults
@sreenath.n: yes, i think that’s baked in
then api-defaults
or secure-api-defaults
would do the trick, I guess
@sreenath.n: looking at the definitions for those i’m not seeing how they bear on this, can you explain?
AFAICS all they are doing is removing the :security {:anti-forgery true} that comes in the regular defaults
If you go with site defaults - https://github.com/ring-clojure/ring-defaults/blob/master/src/ring/middleware/defaults.clj#L36
anti-forgery is enabled.
yes. as i just mentioned i had disabled that, but i’m not clear it’s a good solution to just do away with it
what i was asking was whether i was missing how your suggestion pertained to transferring the token to the app
Ahh.. I see your point now.
I’m still a little puzzled why the *anti-forgery-token*
var is unbound in the compojure head
fn
Ok.. I’ll get back to this one soon.. Looks like an interesting one.. Have a meeting to catch, though.
Meanwhile, I was looking at this one -> https://github.com/ring-clojure/ring-anti-forgery/blob/master/src/ring/middleware/anti_forgery.clj
@sandbags: By default, the token is expected to be in a form field named '__anti-forgery-token’
. So, are you setting it as a hidden field?
Hi, can anyone offer me an explanation of how reactions work in reagent? Most importantly, how it is they know what signals they depend on?
Have you read this? https://github.com/Day8/re-frame#how-flow-happens-in-reagent
@luposlip: yeah I have. This is what I find most perplexing:
To put that yet another way, a reaction detects a computation's input Signals (aka input ratoms) and it will watch them, and when, later, it detects a change in one of them, it will re-run that computation, and it will reset! the new result of that computation into the ratom originally returned.
Is there an add-watch
registered when the input ratoms are deref’d inside the body of the reaction?
yes, kind of
as far as I understand ratoms notify the surrounding "context" about the dereference. you could try looking at the source starting from ratom/deref
: https://github.com/reagent-project/reagent/blob/3e3674ea85f75be7148d57ccbbbdcc2887962574/src/reagent/ratom.cljs#L130
@metametadata: thanks! Yeah it looks like the re-binding of *ratom-context*
is what makes this possible