Skip to content

Commit 1548a8a

Browse files
authored
Merge pull request shakacode#306 from shakacode/alexey/csrf
Disable csrf for json
2 parents 47e4852 + 150e31e commit 1548a8a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
class ApplicationController < ActionController::Base
22
# Prevent CSRF attacks by raising an exception.
33
# For APIs, you may want to use :null_session instead.
4-
protect_from_forgery with: :exception
4+
protect_from_forgery with: :exception,
5+
if: proc { request.headers["X-Auth"] != "tutorial_secret" }
56
end

0 commit comments

Comments
 (0)