koajs / discussions

KoaJS Discussions
2 stars 2 forks source link

How to exclude api router? #30

Open tsurumure opened 4 years ago

tsurumure commented 4 years ago

Hi, i want to run a resultful api in Postman, but i get an error Invalid CSRF token.

How can i exclude my api router from csrf ?

i try to use:

headers: {
  X-CSRF-Token: [csrf-value],
  _csrf: [csrf-value]
}

or

/api/add?csrf=gnwLgVst-Hf-liZtMY3BQwEik9x-Sn4k1-58

but it dosn't work

tsurumure commented 4 years ago

ajax post data: { _csrf: [csrf-value], ... }