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

[Feature]: Split VerifyWPNonce middleware into two seperate middleware #167

Closed
1 task done
calvinalkan opened this issue Nov 8, 2022 · 1 comment
Closed
1 task done
Labels
feature New feature or request released

Comments

@calvinalkan
Copy link
Member

Thanks for taking the time to fill out this feature request!"

  • I have searched the issue tracker for similar requests

Which @snicco/* package(s) are relevant/related of the feature request?

wp-nonce-middleware

Description

Currently, the VerifyWPNonce middleware handles two tasks.

  1. Validating nonces for unsafe request methods.
  2. Adding an instance of the nonce factory to view responses.

These two tasks should be split into separate middleware because currently is very painful to test Controllers if this middleware is applied globally as each request also needs to pass a valid nonce.

If the middleware is omitted for the tests, the views that use the WPNonce factory will throw exceptions because it was not added.

Proposed solution

//

Alternatives

//

@calvinalkan calvinalkan added the feature New feature or request label Nov 8, 2022
calvinalkan added a commit to calvinalkan/snicco that referenced this issue Nov 13, 2022
calvinalkan added a commit to calvinalkan/snicco that referenced this issue Nov 13, 2022
@snicco-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 1.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request released
Projects
None yet
Development

No branches or pull requests

2 participants