Skip to content

Commit

Permalink
[#137] [Example] Update re: ring-anti-forgery recommendations (@eerohele
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ptaoussanis committed Mar 22, 2019
1 parent c516d79 commit 4b929db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion example-project/src/example/server.clj
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@
(defn landing-pg-handler [ring-req]
(hiccup/html
[:h1 "Sente reference example"]
[:div#sente-csrf-token {:data-csrf-token anti-forgery/*anti-forgery-token*}]
(let [csrf-token
;; (:anti-forgery-token ring-req) ; Also an option
(force anti-forgery/*anti-forgery-token*)]

[:div#sente-csrf-token {:data-csrf-token csrf-token}])
[:p "An Ajax/WebSocket" [:strong " (random choice!)"] " has been configured for this example"]
[:hr]
[:p [:strong "Step 1: "] " try hitting the buttons:"]
Expand Down

0 comments on commit 4b929db

Please sign in to comment.