Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fastify/csrf-protection

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/csrf-protection - npm Package Compare versions

Comparing version 7.0.0 to 7.0.1

6

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc