Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow OmniAuthAuthenticityTokenProtection options to be configured #1027

Merged
merged 1 commit into from Jan 16, 2021

Conversation

jkowens
Copy link
Contributor

@jkowens jkowens commented Jan 16, 2021

This will be useful for disabling csrf protection in test suites or configuring the csrf key when the next version of rack-protection is released.

ie:

OmniAuth.config.request_validation_phase = OmniAuth::AuthenticityTokenProtection.new(allow_if: ->(env) { true })

or

OmniAuth.config.request_validation_phase = OmniAuth::AuthenticityTokenProtection.new(key: :_csrf_token)

This will be useful for disabling csrf protection in test suites or
configuring the csrf key when the next version of rack-protection is
released.
@jkowens jkowens changed the title Allow OmniAuthAuthenticityTokenProtection options to be customized Allow OmniAuthAuthenticityTokenProtection options to be configured Jan 16, 2021
@BobbyMcWho
Copy link
Member

Thanks @jkowens, I had been turning it off in test suites by setting OmniAuth.config.request_validation_phase = nil or OmniAuth.config.request_validation_phase = proc {}, but this makes sense to have as well. Going to release it in a patch version release since it honestly should have been present in the 2.0.0 release if I hadn't overlooked it.

@BobbyMcWho BobbyMcWho merged commit b55ad4c into omniauth:master Jan 16, 2021
@jkowens
Copy link
Contributor Author

jkowens commented Jan 16, 2021

Cool, I didn't think of those options! Thanks for the quick release 💯

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.

None yet

2 participants