New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

think-csrf

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

think-csrf - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

index.js

@@ -1,1 +0,1 @@

module.exports = require('./lib/csrf.js');
module.exports = require('./lib/csrf.js');

@@ -17,3 +17,3 @@ const utils = require('./utils.js');

});
}
};
};
};

@@ -11,6 +11,6 @@ const helper = require('think-helper');

return ctx.session(session_name).then(value => {
if (!value) return Promise.reject();
if (!value) throw new Error('Verification failed');
const token = ctx.query[form_name] || ctx.request.body[form_name] || ctx.get(header_name);
if (token !== value) return Promise.reject();
const token = ctx.query[form_name] || (ctx.request.body.post && ctx.request.body.post[form_name]) || ctx.get(header_name);
if (token !== value) throw new Error('Verification failed');
});

@@ -26,4 +26,4 @@ },

});
}
};
}
};
};
{
"name": "think-csrf",
"version": "1.0.0",
"version": "1.0.1",
"description": "CSRF for ThinkJS 3.x",

@@ -14,2 +14,3 @@ "main": "index.js",

"eslint": "^3.18.0",
"eslint-config-think": "^1.0.1",
"koa": "^2.2.0",

@@ -23,3 +24,5 @@ "nyc": "^10.2.0",

"scripts": {
"test": "eslint index.js && nyc ava test/index.js"
"test": "eslint index.js lib/ && nyc ava test/index.js",
"lint": "eslint index.js lib/",
"lint-fix": "eslint --fix index.js lib/"
},

@@ -26,0 +29,0 @@ "repository": {

@@ -38,3 +38,3 @@ # think-csrf

| Name | Description | Default |
| :------: | :------: | :------: |
| :------ | :------ | :------ |
| `session_name` | csrf token's session name | `'csrf_token'` |

@@ -41,0 +41,0 @@ | `form_name` | request csrf token's name in body and query | `'_csrf'` |

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