@fastify/csrf-protection
Advanced tools
Comparing version 7.0.0 to 7.0.1
{ | ||
"name": "@fastify/csrf-protection", | ||
"version": "7.0.0", | ||
"version": "7.0.1", | ||
"description": "A plugin for adding CSRF protection to Fastify.", | ||
@@ -42,5 +42,5 @@ "main": "index.js", | ||
"@types/node": "^22.0.0", | ||
"fastify": "^5.0.0-alpha.4", | ||
"fastify": "^5.0.0", | ||
"proxyquire": "^2.1.3", | ||
"sinon": "^18.0.0", | ||
"sinon": "^19.0.2", | ||
"standard": "^17.1.0", | ||
@@ -47,0 +47,0 @@ "tap": "^18.7.2", |
@@ -50,3 +50,3 @@ # @fastify/csrf-protection | ||
handler: async (req, reply) => { | ||
const token = await reply.generateCsrf() | ||
const token = reply.generateCsrf() | ||
return { token } | ||
@@ -81,3 +81,3 @@ } | ||
handler: async (req, reply) => { | ||
const token = await reply.generateCsrf() | ||
const token = reply.generateCsrf() | ||
return { token } | ||
@@ -112,3 +112,3 @@ } | ||
handler: async (req, reply) => { | ||
const token = await reply.generateCsrf() | ||
const token = reply.generateCsrf() | ||
return { token } | ||
@@ -159,3 +159,3 @@ } | ||
```js | ||
const token = await reply.generateCsrf() | ||
const token = reply.generateCsrf() | ||
``` | ||
@@ -162,0 +162,0 @@ |
@@ -35,3 +35,3 @@ 'use strict' | ||
fastify.get('/', async (req, reply) => { | ||
const token = await reply.generateCsrf() | ||
const token = reply.generateCsrf() | ||
return { token } | ||
@@ -183,3 +183,3 @@ }) | ||
fastify.get('/', async (req, reply) => { | ||
const token = await reply.generateCsrf() | ||
const token = reply.generateCsrf() | ||
return { token } | ||
@@ -279,3 +279,3 @@ }) | ||
fastify.get('/', async (req, reply) => { | ||
const token = await reply.generateCsrf({ path: '/hello' }) | ||
const token = reply.generateCsrf({ path: '/hello' }) | ||
return { token } | ||
@@ -282,0 +282,0 @@ }) |
@@ -31,3 +31,3 @@ 'use strict' | ||
fastify.post('/login', async (req, reply) => { | ||
const token = await reply.generateCsrf({ userInfo: userInfoDB[req.body.username] }) | ||
const token = reply.generateCsrf({ userInfo: userInfoDB[req.body.username] }) | ||
return { token } | ||
@@ -88,3 +88,3 @@ }) | ||
req.session.username = req.body.username | ||
const token = await reply.generateCsrf({ userInfo: req.body.username }) | ||
const token = reply.generateCsrf({ userInfo: req.body.username }) | ||
return { token } | ||
@@ -141,3 +141,3 @@ }) | ||
req.session.set('username', req.body.username) | ||
const token = await reply.generateCsrf({ userInfo: req.body.username }) | ||
const token = reply.generateCsrf({ userInfo: req.body.username }) | ||
return { token } | ||
@@ -144,0 +144,0 @@ }) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37639