As discussed in Tempest discord, it will be a good idea to implement a better approach to manage CSRF token in fetch post requests (for example when uploading images).
As Enzo said a better approach could be to use the same as Axios here :
https://github.com/axios/axios/blob/6d84189349c43b1dcdd977b522610660cc4c7042/lib/helpers/resolveConfig.js#L43-L52