NIk*_*and 5 ruby-on-rails protect-from-forgery facebook-graph-api omniauth-facebook ruby-on-rails-5
我正在开发一个从 facebook 获取详细信息的 Rails 应用程序。我已经从 facebook 获取了详细信息。但是当我刷新网页时,我收到了一个名为 CSRF 检测到的错误。我用过一些方法,但都失败了。
facebook Graph API 用于编辑操作。
这些是在员工控制器的内部类中添加的。
skip_before_action :verify_authenticity_token
skip_before_action :verify_authenticity_token, only: [:edit]
protect_from_forgery :only => [:edit]
skip_before_action :authenticate_user, only: [:edit]
skip_before_action :authenticate_user!
当使用 authentication_user 时(第 4 和第 5 种情况)我收到一个参数错误,
Before process_action callback :authenticate_user has not been defined .
在所有其他情况下,使用 facebook 更新页面后刷新页面时的错误是
OmniAuth::Strategies::OAuth2::CallbackError
csrf_detected | CSRF detected
PS:我使用了 'omniauth-facebook' 和 'koala' gem 进行集成。
| 归档时间: |
|
| 查看次数: |
2071 次 |
| 最近记录: |