0
votes

My problem: I add facebook omniAuth by this guides (http://sourcey.com/rails-4-omniauth-using-devise-with-twitter-facebook-and-linkedin/). omniAuth work, but I need redirect user after sign_in to url, where user click facebook button.

In OmniauthCallbacksController I have method:

def after_sign_in_path_for(resource)
 if resource.email_verified?
   super resource
 else
  finish_signup_path(resource)
end

end

When I change 'super resource' to 'profiles_path', It is redirect me to profiles page.

How to fix redirect to current page?

1
not clear what you are asking. - Ahmad Al-kheat

1 Answers

-1
votes

To redirect the user to the URL where he clicked the Facebook button:

    redirect_to request.referer