4

I'm trying to follow along with this solution for displaying Facebook as a popup with omniauth:

Turn omniauth facebook login into a popup

However the Answer states:

And then in your callback view:

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

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

Community
  • 1
  • 1
Rapture
  • 1,876
  • 10
  • 23
  • 42

1 Answers1

1

In your routes.rb file you must have specified callback with OmniAuth like this:

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

Where You can have your action/method back in your 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 one.

Surya
  • 15,703
  • 3
  • 51
  • 74