Skip to content

Commit

Permalink
Skip CSRF check if a valid JWT is passed in
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya Mattos committed May 25, 2020
1 parent f623184 commit 141a5b5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/controllers/shopify_app/authenticated_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ module ShopifyApp
class AuthenticatedController < ActionController::Base
include ShopifyApp::Authenticated

protect_from_forgery with: :exception
protect_from_forgery with: :exception, unless: :valid_jwt_header?

private

def valid_jwt_header?
jwt_shopify_domain.present?
end
end
end

0 comments on commit 141a5b5

Please sign in to comment.