我使用 OmniAuth-Identity 进行登录,并使用 Ajax 调用进行登录。尝试登录传递 JSON 数据不起作用。
例如这有效:
curl -i -H "Accept: application/json" -d "[email protected] /cdn-cgi/l/email-protection&password=cheesestix" "http://0.0.0.0:3000/auth/identity/callback"
这不会,它返回“无效凭据”
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -d '{"auth_key":"[email protected] /cdn-cgi/l/email-protection","password":"cheesestix"}' "http://0.0.0.0:3000/auth/identity/callback"
这是一个已知的问题?因为我使用的是 AngularJS,所以对我的数据进行表单编码会很困难。
UPDATE:
一位 Rails 人员通过将 JSON 支持反向移植到 Rack 中修复了这个问题。
gem 'rack', git: 'https://github.com/ssoroka/rack.git', branch: '1.5.2-json-support-backport'
我很犹豫是否将其作为答案发布,因为我不太了解 Rack 的细节,无法解释任何事情。但相关的差异在这里:https://github.com/ssoroka/rack/commit/d8e2e2af6da57805d2f0906ce925ea150def31a0 https://github.com/ssoroka/rack/commit/d8e2e2af6da57805d2f0906ce925ea150def31a0
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)