WordPress.org

Make WordPress Core

Opened 20 months ago

Closed 18 months ago

Last modified 18 months ago

#43265 closed defect (bug) (fixed)

REST API JS Client: Extend custom nonce functionality to collections

Reported by: ocean90 Owned by: adamsilverstein
Milestone: 4.9.5 Priority: normal
Severity: normal Version: 4.9
Component: REST API Keywords: has-patch needs-testing
Focuses: javascript Cc:

Description

This is a follow-up to #40422.

Since [41553] a custom nonce can be passed to an API client. But when requesting a collection the nonce isn't used because WPApiBaseCollection is still using wpApiSettings.nonce. Chatted with @adamsilverstein and it seems to be an oversight.

Attached an initial patch.

Attachments (2)

43265.patch (1.4 KB) - added by ocean90 20 months ago.
43265.2.patch (2.1 KB) - added by ocean90 20 months ago.
Replace new nonces

Download all attachments as: .zip

Change History (7)

@ocean90
20 months ago

@ocean90
20 months ago

Replace new nonces

#1 @adamsilverstein
20 months ago

  • Owner set to adamsilverstein
  • Status changed from new to assigned

#2 @adamsilverstein
19 months ago

  • Keywords needs-testing added
  • Milestone changed from Awaiting Review to 5.0

#3 @ocean90
19 months ago

  • Milestone changed from 5.0 to 4.9.5

Moving to 4.9.5 to get this in line with #43266 and #42948.

Last edited 19 months ago by ocean90 (previous) (diff)

#4 @ocean90
18 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 42851:

REST API JS Client: Extend custom nonce functionality to collections.

This brings the improved nonce handling from [41553] to collections to remove the direct wpApiSettings.nonce dependency.

Props adamsilverstein, ocean90, swissspidy.
Fixes #43265.

#5 @ocean90
18 months ago

In 42853:

REST API JS Client: Extend custom nonce functionality to collections.

This brings the improved nonce handling from [41553] to collections to remove the direct wpApiSettings.nonce dependency.

Merge of [42851] to the 4.9 branch.

Props adamsilverstein, ocean90, swissspidy.
See #43265.

Note: See TracTickets for help on using tickets.