From e1385be025263fad6d339010d42fe553d1de64af Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 17 Nov 2009 23:36:48 -0800 Subject: Extract form_authenticity_param instance method so it's overridable in subclasses --- actionpack/lib/action_controller/metal/request_forgery_protection.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionpack/lib/action_controller/metal/request_forgery_protection.rb') diff --git a/actionpack/lib/action_controller/metal/request_forgery_protection.rb b/actionpack/lib/action_controller/metal/request_forgery_protection.rb index 113c20a758..173df79ee7 100644 --- a/actionpack/lib/action_controller/metal/request_forgery_protection.rb +++ b/actionpack/lib/action_controller/metal/request_forgery_protection.rb @@ -101,6 +101,11 @@ module ActionController #:nodoc: session[:_csrf_token] ||= ActiveSupport::SecureRandom.base64(32) end + # The form's authenticity parameter. Override to provide your own. + def form_authenticity_param + params[request_forgery_protection_token] + end + def protect_against_forgery? allow_forgery_protection end -- cgit v1.2.3