Forem Creators and Builders 🌱

Discussion on: InvalidAuthenticityToken with Docker setup

Collapse
 
markomannux profile image
markomannux

Hey @akhil , thanks for your hint: it put me on the right track. I had no clue hostname could be an issue.
Since I don't actually need social login, turns out the setup is even simpler.

I tried to set APP_DOMAIN with no luck but I noticed that container-compose.yml declared it as rails.

So I added an entry in my hosts file like this

127.0.0.1 rails
Enter fullscreen mode Exit fullscreen mode

navigated to http://rails:3000 (no need to change the port) and no more InvalidAuthenticityToken error 🎉

Thanks again!

Collapse
 
akhil profile image
Akhil Naidu

Rather than modifying the host file, what about changing it in the container-compose.yml?

Thread Thread
 
markomannux profile image
markomannux

If I had a DNS record pointing to my environment, that would be certainly better.

For a local setup for testing purposes without DNS, I think the hosts file record is the only viable option.

Thanks again!