Skip to content

Commit

Permalink
Add example of how to use generate CSRF token in config
Browse files Browse the repository at this point in the history
  • Loading branch information
mousavian authored Feb 26, 2017
1 parent b5d8d23 commit 38ab102
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 38ab102

Please sign in to comment.