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

@fastify/csrf-protection

Package Overview
Dependencies
Maintainers
20
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 6.3.0 to 6.4.0

.gitattributes

2

index.js
'use strict'
const assert = require('assert')
const assert = require('node:assert')
const fp = require('fastify-plugin')

@@ -5,0 +5,0 @@ const CSRF = require('@fastify/csrf')

{
"name": "@fastify/csrf-protection",
"version": "6.3.0",
"version": "6.4.0",
"description": "A plugin for adding CSRF protection to Fastify.",
"main": "index.js",
"type": "commonjs",
"types": "types/index.d.ts",

@@ -36,13 +37,13 @@ "scripts": {

"devDependencies": {
"@fastify/cookie": "^8.0.0",
"@fastify/cookie": "^9.0.4",
"@fastify/pre-commit": "^2.0.2",
"@fastify/secure-session": "^6.0.0",
"@fastify/session": "^10.0.0",
"@types/node": "^18.0.0",
"@fastify/secure-session": "^7.0.0",
"@fastify/session": "^10.3.0",
"@types/node": "^20.1.0",
"fastify": "^4.2.0",
"proxyquire": "^2.1.3",
"sinon": "^15.0.0",
"sinon": "^17.0.0",
"standard": "^17.0.0",
"tap": "^16.0.0",
"tsd": "^0.28.0"
"tsd": "^0.29.0"
},

@@ -49,0 +50,0 @@ "pre-commit": [

@@ -72,3 +72,3 @@ # @fastify/csrf-protection

```js
fastify.register(require('@fastify-session'))
fastify.register(require('@fastify-session'), { secret: "a string which is longer than 32 characters" })
fastify.register(require('@fastify/csrf-protection'), { sessionPlugin: '@fastify/session' })

@@ -103,3 +103,3 @@

```js
fastify.register(require('@fastify/secure-session'))
fastify.register(require('@fastify/secure-session'), { secret: "a string which is longer than 32 characters" })
fastify.register(require('@fastify/csrf-protection'), { sessionPlugin: '@fastify/secure-session' })

@@ -106,0 +106,0 @@

@@ -9,2 +9,8 @@ import Fastify from 'fastify'

declare module 'fastify' {
interface Session {
username: string
}
}
async function run() {

@@ -44,3 +50,3 @@ await fastify.register(FastifyCookie)

getUserInfo(req) {
return req.session.get('username')
return req.session.get<'username', string>('username')
}

@@ -47,0 +53,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