1.0.1 • Published 6 years ago

node-nonce v1.0.1

Weekly downloads
7
License
GPLv3
Repository
github
Last release
6 years ago

Node.js Nonce

Authenticate your web forms and endpoints easily and tokenize your actions to prevent CSRF.

npm install node-nonce --save
const nonce = require('node-nonce').config({
    secret: 'eiwer9weriorl2342i323i4e'
});

// init
nonce.init( req, res ); // request and response (HTTP)

// create a nonce
const nonce_token = nonce.create( 'some-action' );

// verify a nonce
nonce.verify( nonce_token, 'some-action' );

I am still working on this.