我对Pow和Omniauth有一个奇怪的问题。Omniauth (Facebook Login)在使用localhost:3000时工作得很好,但当使用Pow (appname.dev)时就有点可疑了。
如果数据库中不存在用户,则会执行重定向并正确创建用户,因为它们应该存在。但是,在此之后,它们会被重定向到root_path,而不是登录。他们的记录会按预期保存在数据库中,但不会进行登录。同样,这只发生在Pow (和lvh.me)上,而不是本地主机上。
有什么想法吗?
我使用Devise/Omniauth方法进行登录,控制器代码如下所示:
def facebook
@user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user)
if @user.persisted?
flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook"
sign_in_and_redirect @user, :event => :authentication
else
session["devise.facebook_data"] = request.env["omniauth.auth"]
redirect_to new_user_registration_url
end
end同样,用户是持久化的,但在使用POW时不会出现闪光通知或sign_in。
发布于 2012-06-12 07:02:35
检查会话是否被设置为可能正在阻止它(例如,在您的情况下需要清除浏览器cookie)。
https://stackoverflow.com/questions/10940194
复制相似问题