Hi,
Thanks for the message.
HikaShop actually doesn't do either of this.
When you're triggering the upload of a file on the page, the HikaShop javascript will now call
Joomla.getOptions("csrf.token", "")
in order to get the current CSRF token served by the Joomla javascript.
If HikaShop is getting the old CSRF token when doing this, it means that on top of updating the DOM with the JSON, JCHOptimize should also update the data in the Joomla object. As far as I know, the way I did it is the proper way to read the CSRF token on the client side for an extension.
Or maybe I'm missing something ?
Please understand that I'm not familiar with how JCHOptimize works.