【问题标题】:Cannot skip CSRF security for controller无法跳过控制器的 CSRF 安全性
【发布时间】:2014-09-09 04:52:35
【问题描述】:

我想为一个控制器禁用 CSRF 安全性。我的 ApplicationController 如下所示:

class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  protect_from_forgery with: :exception

以及我想跳过的控制器:

class HelpdeskInboxController < ApplicationController

  skip_before_action :authenticate_user!
  skip_before_action :verify_authenticity_token
  prepend_before_filter :require_no_authentication

  include Mandrill::Rails::WebHookProcessor
  authenticate_with_mandrill_keys! MANDRILL_CONFIG['WEBHOOKS']

它不工作我有错误

Can't verify CSRF token authenticity

当 mandrill 给我发邮件时。

【问题讨论】:

    标签: ruby ruby-on-rails-4 csrf mandrill csrf-protection


    【解决方案1】:

    我相信skip_before_action :verify_authenticity_token 仅适用于rails 4。请尝试使用skip_before_filter

    【讨论】:

      猜你喜欢
      • 2015-04-12
      • 2015-07-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-15
      • 1970-01-01
      • 2017-10-27
      • 2023-03-17
      相关资源
      最近更新 更多