Skip to content

Commit

Permalink
Merge pull request #2 from luukveenis/skip-csrf-protection-on-callback
Browse files Browse the repository at this point in the history
Skip CSRF protection check on callback route
  • Loading branch information
alepore authored Aug 16, 2017
2 parents 0cbb742 + 6aebf61 commit 06802a6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@ Metrics/ParameterLists:
Metrics/PerceivedComplexity:
Enabled: false

Bundler/OrderedGems:
Enabled: false

Bundler/DuplicatedGem:
Enabled: false

Metrics/BlockLength:
Exclude:
- 'spec/**/*.rb'
Expand Down
12 changes: 9 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ gem 'solidus', github: 'solidusio/solidus', branch: branch
# Provides basic authentication functionality for testing parts of your engine
gem 'solidus_auth_devise'

if branch < 'v2.0'
gem 'rails', '~> 4.2.7'
gem 'rails_test_params_backport', group: :test
if branch == 'master' || branch >= "v2.3"
gem 'rails', '~> 5.1.0' # HACK: broken bundler dependency resolution
gem "rails-controller-testing", group: :test
elsif branch >= "v2.0"
gem 'rails', '~> 5.0.3' # HACK: broken bundler dependency resolution
gem "rails-controller-testing", group: :test
else
gem "rails", '~> 4.2.0' # HACK: broken bundler dependency resolution
gem "rails_test_params_backport", group: :test
end

gemspec
3 changes: 3 additions & 0 deletions app/controllers/spree/paybright_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module Spree
class PaybrightController < Spree::BaseController
# We can't use CSRF protection on a route that's hit by an external service
skip_before_action :verify_authenticity_token, only: :callback, raise: false

# Server2server call that gets parameters about the results of the Paybright
# transaction.
def callback
Expand Down

0 comments on commit 06802a6

Please sign in to comment.