Agree, with one mention: it depends how csrf
is implemented! You have to keep in mind that Strapi token
is valid for a month! When you use httpOnly cookie
without secure flag
the cookie can be captured since it will remain saved in some logs. See more about httpOnly cookie - secure flag.
Regarding implementation, I think the best way is to do this on downstream, not in Strapi. This is how I did it in my Strapi Access Proxy project where I used csurf
and jsonwebtoken
libraries, you may want to study it to see how to implement a solution in any way you want.