我正在omniauth
使用devise
。我的控制器在下面
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def facebook
# You need to implement the method below in your model (e.g. app/models/user.rb)
@user = User.from_omniauth(request.env["omniauth.auth"])
if @user.persisted?
sign_in_and_redirect @user, :event => :authentication #this will throw if @user is not activated
set_flash_message(:notice, :success, :kind => "Facebook") if is_navigational_format?
else
# session["devise.facebook_data"] = request.env["omniauth.auth"]
redirect_to new_user_registration_url
end
end
end
如果用户已登录并持续,则将用户重定向到注册页面。我做了哪些更改以在主页重定向用户....... ????? 请帮帮我
答案 0 :(得分:0)
在sign_in路径后设置了吗?
#application_controller.rb
def after_sign_in_path_for(resource_or_scope)
case resource_or_scope
when :user, User
root_path
else
super
end
end
如果您遇到其他错误,请在此处粘贴