Fork me on GitHub
#reagent
<
2016-08-16
>
sandbags08:08:54

@sreenath.n: yes, i think that’s baked in

sreenath.n08:08:13

then api-defaults or secure-api-defaults would do the trick, I guess

sandbags08:08:09

@sreenath.n: looking at the definitions for those i’m not seeing how they bear on this, can you explain?

sandbags08:08:01

AFAICS all they are doing is removing the :security {:anti-forgery true} that comes in the regular defaults

sandbags08:08:23

(which I have anyway bypassed temporarily while I figure out a better approach)

sreenath.n08:08:28

anti-forgery is enabled.

sandbags08:08:07

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

sandbags08:08:28

what i was asking was whether i was missing how your suggestion pertained to transferring the token to the app

sreenath.n08:08:46

Ahh.. I see your point now.

sandbags08:08:49

Thanks for the suggestion though.

sandbags08:08:13

I’m still a little puzzled why the *anti-forgery-token* var is unbound in the compojure head fn

sreenath.n08:08:58

Ok.. I’ll get back to this one soon.. Looks like an interesting one.. Have a meeting to catch, though.

sandbags08:08:07

at that point i would expect there to be a session and hence a token

sandbags08:08:25

yes, that’s the code at work

sreenath.n09:08:03

@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?

lsnape09:08:05

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?

lsnape12:08:11

@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?

metametadata12:08:34

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

lsnape12:08:16

@metametadata: thanks! Yeah it looks like the re-binding of *ratom-context* is what makes this possible

lsnape12:08:51

Still unsure of exactly how but now I know where to look 🙂