Forem Creators and Builders 🌱

oni-bez-tabu
oni-bez-tabu

Posted on

OmniAuth - invalidauthenticitytoken. OAuth Facebook, Google problem.

Hey,

I’m struggling with a problem logging in through Facebook and Google, which is definitely related to an issue with OmniAuth. I have both a development version and a production version that I’ve been maintaining for a month. The production version is running on Heroku and is fully configured. I wanted to enable Login via Facebook and Google, and the test version in the development environment works fine. However, when I transfer the keys and configuration to production, I encounter an error after clicking the button (submitting the “Log in with Facebook/Google” form):

ActionController::InvalidAuthenticityToken
Enter fullscreen mode Exit fullscreen mode

Of course, all other forms and functionalities on the site work correctly; the problem is exclusively with these buttons and their forms.

Has anyone encountered a similar issue?

Top comments (1)

Collapse
 
onibeztabu profile image
oni-bez-tabu

SOLVED! The problem was the SSL setting in Cloudflare. By default, it is set to Flexible, it needed to be changed to the Full option…