addict
addict copied to clipboard
Needed to configure generate_csrf_token
On a fresh install I was getting invalid CSRF errors when submitting the login form.
It turned out config.generate_csrf_token
was nil, and addict was rendering a blank value in the CSRF hidden form field.
The fix was to add
generate_csrf_token: (fn -> Phoenix.Controller.get_csrf_token end)
to my config.
As this isn't mentioned in the docs, this could be a bug I guess, or (more likely) there may be something screwy elsewhere in my config?
Posting mainly for the benefit of others who may hit this. For my part it's working and I'm moving on : )
@tslocke where exactly do you put this?
@MaxPleaner This would go in your :addict
config in the config.exs
.
It fails on mix release
if I add this string. I had similar issue before: #70
Looks like config.exs
isn't a good place for functions.. Though I'm not sure and will appreciate any clarifications on this.