AdonisJS Error Code “EBADCSRFTOKEN” in Postman in PUT,POST,DELETE operation

不羁岁月 提交于 2019-12-06 07:23:55
Amit Patel

Put filterUris in your route path like this

csrf: {
    enable: true,
    methods: ['POST', 'PUT', 'DELETE'],
    filterUris: ['/firstroute','*',],
    cookieOptions: {
      httpOnly: false,
      sameSite: true,
      path: '/',
      maxAge: 7200
    }
  }

More read about csrf visit this website adonisjs


Second way is

  • Create REST API project. when creating API then not need a view. This error generates when not getting csrftoken. So you can try to create a project for the only API not include view like this adonis new projectname --api-only

More info follow this link how to create an API project.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!