2

I am new in nestjs and trying to do nestjs csrf security with fastify adpater. The document doesn't say much how to do.

This is how I am trying to do

import fastifyCsrf from 'fastify-csrf'; and using it inside main.ts file like this app.register(fastifyCsrf);

Now I don't see it setting up any header with csrf or anything like this. Is this all or I have to do something more?

Before using csrf code i am also using cookie like this

 app.register(fastifyCookie, {
   secret: 'my-secret', // for cookies signature
 });

Any idea how can I actually make it work?

Thank you.

Hkm Sadek
  • 2,987
  • 9
  • 43
  • 95

0 Answers0