hmm, I ran a mix deps.update --all and I think I got a new version of plug (1.5) installed.
Im getting an error now on a call to a different Phoenix umbrella app.
cannot generate CSRF token for a host because get_csrf_token_for/1 is invoked in a separate process than the one that started the request
Im running an umbrella behind a proxy, so I think the error is correct, its a separate proces where the call is coming from
I read in the plug documentation allow_hosts option, maybe this would solve my problem?
But where so i set this option in phoenix?
A few things could cause this, one is not having the CSRF protection plugin the pipeline, another would be having a server handle the request for the wrong host, etc…
Thanks for help. FWIW I’m seeing this error in a Phoenix app which appears to be invoking the Plug.CSRFProtection, i.e. it’s not explicitly listed in my Plug pipeline.
test/views/layout_view_test.exs:38
** (RuntimeError) cannot generate CSRF token for a host because get_csrf_token_for/1 is invoked in a separate process than the one that started the request
stacktrace:
(plug) lib/plug/csrf_protection.ex:181: Plug.CSRFProtection.get_csrf_token_for/1
(phoenix_html) lib/phoenix_html/tag.ex:267: Phoenix.HTML.Tag.csrf_token_tag/3
(phoenix_html) lib/phoenix_html/tag.ex:220: Phoenix.HTML.Tag.form_tag/2
(phoenix_html) lib/phoenix_html/form.ex:288: Phoenix.HTML.Form.form_for/4
...