File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
lib/omniauth/rails_csrf_protection Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -13,19 +13,20 @@ module RailsCsrfProtection
13
13
# authenticity token, you can find the source code at
14
14
# https://github.com/rails/rails/blob/v5.2.2/actionpack/lib/action_controller/metal/request_forgery_protection.rb#L217-L240.
15
15
class TokenVerifier
16
+ # Inherits config from ActionController::Base.
17
+ # Define _before_ including ActionController::RequestForgeryProtection.
18
+ def self . config
19
+ @_config ||= ActionController ::Base . config . inheritable_copy
20
+ end
21
+
16
22
include ActiveSupport ::Configurable
17
23
include ActionController ::RequestForgeryProtection
18
24
19
25
# `ActionController::RequestForgeryProtection` contains a few
20
26
# configurable options. As we want to make sure that our configuration is
21
27
# the same as what being set in `ActionController::Base`, we should make
22
- # all out configuration methods to delegate to `ActionController::Base`.
23
- config . each_key do |configuration_name |
24
- undef_method configuration_name
25
- define_method configuration_name do
26
- ActionController ::Base . config [ configuration_name ]
27
- end
28
- end
28
+ # our configuration delegate to `ActionController::Base`.
29
+ config . each_key do |key | config . delete ( key ) end
29
30
30
31
def call ( env )
31
32
dup . _call ( env )
You can’t perform that action at this time.
0 commit comments