Skip to content

Allow to customize forgery protection settings#2989

Merged
mshibuya merged 1 commit into
railsadminteam:masterfrom
Kaligo:feature/configurable_csrf_protection
Feb 17, 2018
Merged

Allow to customize forgery protection settings#2989
mshibuya merged 1 commit into
railsadminteam:masterfrom
Kaligo:feature/configurable_csrf_protection

Conversation

@arnvald

@arnvald arnvald commented Feb 2, 2018

Copy link
Copy Markdown
Contributor

Currently protect_from_forgery is always called with with: :exception,
which might becausing problems in certain applications.

This commit enables configuration for protect_from_forgery method,
and keeps with: :exception as default settings

Currently `protect_from_forgery` is always called with `with: :exception`,
which might becausing problems in certain applications.

This commit enables configuration for `protect_from_forgery` method,
and keeps `with: :exception` as default settings
@mshibuya mshibuya merged commit 7679269 into railsadminteam:master Feb 17, 2018
@mshibuya

Copy link
Copy Markdown
Member

Nice, thanks!

@sarink

sarink commented Nov 30, 2018

Copy link
Copy Markdown

Is there anyway to disable it completely? How would one use skip_forgery_protection? https://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection/ClassMethods.html

Update: I guess we can just use the if option and pass a lambda like so { if: -> () { false } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants