From 38ab102427f31a1a71cf7f0ebe4553a3f732e2be Mon Sep 17 00:00:00 2001 From: Rahman Date: Sun, 26 Feb 2017 16:53:37 +0800 Subject: [PATCH] Add example of how to use generate CSRF token in config --- configs.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/configs.md b/configs.md index bb1e731..f75c799 100644 --- a/configs.md +++ b/configs.md @@ -133,7 +133,15 @@ config :addict, # CSRF Token -If you're using CSRF token generation, use the `generate_csrf_token` configuration value to pass the function responsible for it. +If you're using CSRF token generation, use the `generate_csrf_token` configuration value to pass the function responsible for it. For instance on your configuration file: + +```elixir +# config.exs + +config :addict, + (...), + generate_csrf_token: (fn -> Phoenix.Controller.get_csrf_token end) +``` # Not Logged in Redirect