#43266 closed enhancement (fixed)
REST API JavaScript Client: Support an empty string for nonce
Reported by: | ocean90 | Owned by: | adamsilverstein |
---|---|---|---|
Milestone: | 4.9.5 | Priority: | normal |
Severity: | normal | Version: | 4.9 |
Component: | REST API | Keywords: | has-patch commit |
Focuses: | javascript | Cc: |
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.
Fall back to empty string if wpApiSettings.nonce isn't set.