Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-5607

Endpoints always fail if page is cached with expired nonce

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Released
    • Icon: Must have Must have
    • 2.42.0
    • None
    • 3
    • Blocks (all)
    • Sprint #147
    • janus

      It sometimes occurs that a page is cached with an invalid nonce (probably expired). This nonce is passed to endpoints that don't require a nonce, but if you pass one and it's invalid then the endpoint will still respond with 403, breaking the block that needs that data.

      This can easily be prevented by not using `apiFetch`, but a regular `fetch`, which doesn't pass the nonce. Like we had already done for the Articles block for another issue (wpml language was not passed and needed to use the correct language base url). So probably that issue is also occurring and will be solved by this change.

       

      Tasks:

      • Use fetch on the frontend wherever now apiFetch is used.

            pvincent Pieter Vincent
            pvincent Pieter Vincent
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: