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

feat: Support CSRF token retrieval from header "X-CSRF-Token" #422

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

masterT
Copy link

@masterT masterT commented Apr 1, 2023

Retrieve the request CSRF token from the HTTP header X-CSRF-Token in the case the params _csrf_token is not provided.

Reference:

#
# Override this method, for custom handling of the request token retrieval.
#
# @since 2.X.X
Copy link
Author

@masterT masterT Apr 1, 2023

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?

@timriley
Copy link
Member

timriley commented Apr 3, 2023

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?

@masterT
Copy link
Author

masterT commented Apr 3, 2023

Sure, I will craft something.

@masterT masterT changed the title feat: Support custom CSRF token retrieval. feat: Support CSRF token retrieval from header "X-CSRF-Token" Apr 4, 2023
@masterT
Copy link
Author

masterT commented Apr 4, 2023

I did implement your suggestion, this is ready for review. 🙂 @timriley

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.

2 participants