Skip to content

Commit 150e31e

Browse files
alexeulerjustin808
authored andcommitted
Disable csrf for tutorial react-native app
Tutorial has to send the following header: "X-Auth": "tutorial_secret" and then CSRF is ignored.
1 parent 47e4852 commit 150e31e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
Lines changed: 2 additions & 1 deletion
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)