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

electrode-csrf-jwt

Package Overview
Dependencies
Maintainers
3
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electrode-csrf-jwt - npm Package Compare versions

Comparing version 1.1.2 to 1.2.0

lib/csrf-koa.js

4

lib/index.js

@@ -5,6 +5,8 @@ "use strict";

const csrfExpress = require("./csrf-express");
const csrfKoa = require("./csrf-koa");
module.exports = {
register: csrfHapi,
expressMiddleware: csrfExpress
expressMiddleware: csrfExpress,
koaMiddleware: csrfKoa
};
{
"name": "electrode-csrf-jwt",
"version": "1.1.2",
"version": "1.2.0",
"description": "",

@@ -9,3 +9,3 @@ "main": "lib/index.js",

"test": "npm run lint && gulp test",
"coverage": "istanbul cover -x lib/csrf-express.js node_modules/.bin/_mocha",
"coverage": "istanbul cover -x lib/csrf-express.js lib/csrf-koa.js node_modules/.bin/_mocha",
"prepublish": "npm test"

@@ -45,2 +45,5 @@ },

"istanbul": "^0.4.5",
"koa": "^2.0.0",
"koa-bodyparser": "^3.2.0",
"koa-router": "^7.0.1",
"mocha": "^3.0.2",

@@ -47,0 +50,0 @@ "vision": "^4.0.1"

@@ -5,3 +5,3 @@ # Electrode CSRF JWT

An electrode plugin that enables stateless CSRF protection using [JWT](https://github.com/auth0/node-jsonwebtoken) in Electrode, Express, or Hapi applications.
An electrode plugin that enables stateless CSRF protection using [JWT](https://github.com/auth0/node-jsonwebtoken) in Electrode, Express, Hapi, or Koa 2 applications.

@@ -59,3 +59,3 @@ ## Why do we need this module?

This module can be used with either [Electrode](#electrode), [Express](#express), or [Hapi](#hapi).
This module can be used with either [Electrode](#electrode), [Express](#express), [Hapi](#hapi), or [Koa 2](#koa-2).

@@ -118,2 +118,20 @@ ### Electrode

### Koa 2
#### Example `app.js` configuration
```js
const csrfMiddleware = require("electrode-csrf-jwt").koaMiddleware;
const Koa = require("koa");
const app = new Koa();
const options = {
secret: "shhhhh",
expiresIn: 60
};
app.use(csrfMiddleware(options));
```
Built with :heart: by [Team Electrode](https://github.com/orgs/electrode-io/people) @WalmartLabs.

@@ -120,0 +138,0 @@

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