-
-
Notifications
You must be signed in to change notification settings - Fork 119
feat: Support CSRF token retrieval from header "X-CSRF-Token" #422
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
feat: Support CSRF token retrieval from header "X-CSRF-Token" #422
Conversation
| # | ||
| # Override this method, for custom handling of the request token retrieval. | ||
| # | ||
| # @since 2.X.X |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should the version be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is planned for 2.3.0
|
Thanks for putting this together, @masterT! However, rather than leave this as a hook inside actions for users to override, I'd prefer we just fully build in support for checking the header for the CSRF token in addition to the request's params. Would you like to have a go at doing that? |
|
Sure, I will craft something. |
|
I did implement your suggestion, this is ready for review. 🙂 @timriley |
krzykamil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
184fa47 to
32f467d
Compare
|
Thanks again for this feature, @masterT! Your second round of changes looks perfect, and I'll be very happy for us to release this with Hanami 2.3 next week :) |
Retrieve the request CSRF token from the HTTP header
X-CSRF-Tokenin the case the params_csrf_tokenis not provided.Reference: