Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "wordpress-packages/utils/lib/factory/ajax/nonceDeprecationPool"

Index

Variables

Const pool

pool: Record<string, string>

Const recreateFetchPool

recreateFetchPool: Record<string, Promise<string>>

Functions

nonceDeprecationPool

  • nonceDeprecationPool(nonce: string): Promise<string>
  • nonceDeprecationPool(nonce: string, restRecreateNonceEndpoint: string): Promise<string>
  • A REST nonce in WordPress is only valid for 12 hours (can be configured). However, if it gets invalid, the REST endpoints return a 403 error which signals us, we should recreate the nonce. To avoid multiple recreations, we memorize the newly created nonce in a pool.

    Parameters

    • nonce: string

    Returns Promise<string>

  • Parameters

    • nonce: string
    • restRecreateNonceEndpoint: string

    Returns Promise<string>

Generated using TypeDoc