问题
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