-
-
Save shotgundebugging/110b32ba5dc89235804c53bb32486ce6 to your computer and use it in GitHub Desktop.
CSRF protection in Rails - #csrf_meta_tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# actionview/lib/action_view/helpers/csrf_helper.rb | |
def csrf_meta_tags | |
if defined?(protect_against_forgery?) && protect_against_forgery? | |
[ | |
tag("meta", name: "csrf-param", content: request_forgery_protection_token), | |
tag("meta", name: "csrf-token", content: form_authenticity_token) | |
].join("\n").html_safe | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment