Omniauth + facebook error while trying to cancel popup

I am using omniauth-facebook gem in my rails application to allow user sign_in / sign_up via facebook. It works well. But my problem is that when I press the cancel button, I get the following error.

(facebook) Callback phase initiated. (facebook) Authentication failure! invalid_credentials: OmniAuth::Strategies::OAuth2::CallbackError, OmniAuth::Strategies::OAuth2::CallbackError Started GET "/auth/facebook/callback?error_reason=user_denied&error=access_denied&error_description=The+user+denied+your+request." for 127.0.0.1 at 2012-05-18 11:42:36 +0530 

What happened? Adding / auth / failure => 'pages # home' also does not work. Please, help

+6
source share
2 answers

Take a look at the last section https://github.com/intridea/omniauth/wiki/FAQ and see if that helps. He suggests adding

 OmniAuth.config.on_failure = Proc.new { |env| OmniAuth::FailureEndpoint.new(env).redirect_to_failure } 

for your omniauth initializer. This worked for me locally, and then you just need to determine the route / action / out / failure and action.

+6
source

I had the same problem when debugging locally (localhost).
It worked on the public URL, probably the FB should "see" you.

You can test the public url or maybe use some kind of tunnel king ( localtunnel is an ultra simple example).

NTN

0
source

Source: https://habr.com/ru/post/916062/


All Articles