Skip to content

Conversation

@dkotter
Copy link
Collaborator

@dkotter dkotter commented May 22, 2025

Description of the Change

More plugin review feedback was provided around needing a nonce check before we update our authenticated state to true. While we could probably argue our way around this, as we don't actually store any value sent in the URL, we just compare that value to what we already have stored to ensure they match (and thus don't really need a nonce check here), was easy enough to adjust the middleware to send back the initial nonce we give them and then verify that.

So this PR will rely on changes to the middleware (handled in a separate PR in that repo) to fully function.

In addition, changed our check to only fire in the admin and for administrators, which also reduces the scope of when this code is run.

Note

This PR is branched from the plugin-submission branch. This is to help keep a clean slate of what we have submitted to that team for review. We'll want to ensure the code changes here also get merged into develop after

How to test the Change

  1. Checkout the corresponding middleware PR and set that up to run locally
  2. Go through the authentication process in WordPress
  3. Ensure you end up on a success screen and verify authenticated = true in the stored settings

Changelog Entry

Added - Verify our initial nonce before setting the authenticated state

Credits

Props @dkotter

Checklist:

@dkotter dkotter added this to the 1.0.0 milestone May 22, 2025
@dkotter dkotter self-assigned this May 22, 2025
@dkotter dkotter requested a review from faisal-alvi May 22, 2025 18:13
@dkotter dkotter merged commit 002b935 into plugin-submission May 23, 2025
1 check passed
@dkotter dkotter deleted the add/nonce-check branch May 23, 2025 15:15
@dkotter dkotter restored the add/nonce-check branch May 23, 2025 15:15
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