Rails facebook app returns 422 “ the change u wanted was rejected” error

≯℡__Kan透↙ 提交于 2019-12-30 05:20:12

问题


My facebook is just approved today. However,when I clicked on "Go to app", it returns Rail 422 " The change you wanted was rejected. error" I set my Canvas URL to my site url and I am using Omniauth, so I am just wondering what did I miss.


回答1:


Try removing

protect_from_forgery

In the application_controller, or

# you can disable csrf protection on controller-by-controller basis:
skip_before_filter :verify_authenticity_token

Facebook uses signed_request that you can decode and use to verify that the request actually comes from facebook, so protect_from_forgery is unnecessary for applications that are accessible through the facebook canvas only.

More here: Canvas Authentication & ActionController::RequestForgeryProtection




回答2:


Facebook's omniauth error "the change you wanted was rejected" might appear because of your validations set in the model. I had to refactor my validation for users having one unique email, which wasn't working when a user would try to facebook login with the same email.

Look at your logs. heroku logs -t



来源:https://stackoverflow.com/questions/4621514/rails-facebook-app-returns-422-the-change-u-wanted-was-rejected-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!