由于某种原因,我Omniauth Facebook登录被重定向到/用户/ sign_up#= -但除此之外,似乎是工作。 我有这个在routes.rb中:
devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }
我有这样的application.html.erb:
<%= link_to "", user_omniauth_authorize_path(:facebook, :origin=>"root_url") %>
<%= link_to(image_tag("FB-Login.png"),
user_omniauth_authorize_path(:facebook), :origin=>"root_url", class:"mycss") %>
我有这样的application_controller.rb:
def after_sign_in_path_for(resource_or_scope)
Rails.logger.level = 0
logger.debug "after_sign_in_path_for"
logger.debug "Session: #{@session.inspect}"
logger.debug "omniauth.origin: #{omniauth.origin}"
logger.debug "root_url: #{root_url}"
## if request.env['omniauth.origin']
## request.env['omniauth.origin']
request.env['omniauth.origin'] || root_url
end
有趣的是,日志报表未显示在Heroku的日志 - 看起来像after_sign_in_path_for不叫?
任何帮助表示赞赏,斯拉夫科