This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-24
Channels
- # adventofcode (6)
- # announcements (4)
- # aws (21)
- # babashka (36)
- # beginners (58)
- # calva (3)
- # cider (2)
- # clj-kondo (21)
- # clojars (3)
- # clojure (35)
- # clojure-dev (4)
- # clojure-europe (5)
- # clojure-nl (8)
- # clojure-uk (8)
- # clojuredesign-podcast (7)
- # clojurescript (10)
- # core-async (3)
- # data-science (2)
- # datomic (2)
- # defnpodcast (11)
- # duct (4)
- # figwheel-main (1)
- # fulcro (34)
- # graalvm (12)
- # graphql (4)
- # joker (14)
- # kaocha (1)
- # midje (1)
- # off-topic (5)
- # pedestal (1)
- # re-frame (3)
- # reagent (4)
- # reitit (1)
- # shadow-cljs (4)
- # testing (12)
Hey, looking for some advice on handling a changing anti-forgery token between ajax requests. Right now, I'm initially loading the value into an atom, and then reset!
ing that value based on a response header I'm populating. It's not working horribly well, though, the token still ends up getting rejected at some point, and I can't figure out why.
If that happens only after you hot reload your code during development, it might be that you're using def
instead of defonce
. Apart from that, no idea.
I didn't exactly figure it out, but I found a way to make everything simpler, which made the problem go away. I was updating the session in an ajax request, which I think was causing the token to change. When I changed things around so all that information was in the session when the SPA initially loads, everything worked a lot smoother.