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

Fix: CSRF Package Initialization and Configuration Handling #8

Merged
merged 2 commits into from
Aug 22, 2024

Conversation

ibnsultan
Copy link
Member

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe below

Description

This pull request addresses the following issues with the CSRF package:

  • Initialization Order: The \Leaf\Anchor\CSRF::config() method is now called before request verification begins, ensuring that any custom configurations are properly applied before verification occurs.
  • Custom Configuration Support: The code now checks if a csrf.php configuration file exists. If it does, the settings from this file will replace the default configurations in Leaf\Anchor::$config. This allows users to define custom CSRF rules more effectively.

These changes will help prevent unexpected invalidation of requests and ensure that user-defined configurations are respected.

Does this PR introduce a breaking change?

The changes are backward-compatible and should not introduce any breaking changes.

  • Has an Issue
  • Breaking changes

Related Issue

#7

@ibnsultan ibnsultan linked an issue Aug 19, 2024 that may be closed by this pull request
@ibnsultan ibnsultan merged commit 736e409 into leafsphp:main Aug 22, 2024
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.

Unexpected Behavior in CSRF Package Initialization
1 participant