OmniAuth Facebook as a popup

I am trying to follow this solution to display Facebook as a popup with omniauth:

Enable omniauth facebook popup

However, the answer says:

And then in your reverse lookup:

:javascript if(window.opener) { window.opener.location.reload(true); window.close() } 

I followed railscast for a simple omniauth. I use only facebook. I set: display => popup in my initializer. However, I have no reverse lookup, only the session controller and the create action. How can I use the view for a callback so that I can put this code?

+4
source share
1 answer

In your routes.rb file, you should specify the callback using OmniAuth as follows:

 match "/auth/:provider/callback" => "Users#share" 

Where you can return your action / method to the UsersController class:

 def share #Action you with to perform here! end 

and create its view file in views -> users - > share.html.erb

And you may have a different layout for this template, if you prefer to use it.

+1
source

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


All Articles