#43266 closed enhancement (fixed)
REST API JavaScript Client: Support an empty string for nonce
| Reported by: | ocean90 | Owned by: | adamsilverstein |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.9.5 |
| Component: | REST API | Version: | 4.9 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: | javascript |
Description
Example:
myApi = wp.api.init( { versionString: 'my-api/v1/' nonce: '' } );
In this case I don't want the client to include a nonce in requests at all. But because of the args.nonce || wpApiSettings.nonce || '' line it always falls back to wpApiSettings.nonce.
A use case would be a read-only endpoint on another site in a multisite.
Attachments (2)
Change History (8)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Fall back to empty string if wpApiSettings.nonce isn't set.