temp-token

0.2.1 • Public • Published

temp-token

npm npm NPM GitHub package.json dynamic

NPM

Installation

Install it using npm :

$ npm install temp-token

Or install using yarn :

$ yarn add temp-token

Getting started

Import module with this code :

var tempToken = require('temp-token');

And create new TempToken class :

var token = new tempToken.TempToken("your_secret_key");

Usage

Make a temporary token with this function :

token.make("your_token", 1800000); //time in seconds

Check the token is valid :

token.checkToken("your_temp_token");
//if the token is valid, then it returns true
//otherwise it returns false

Package Sidebar

Install

npm i temp-token

Weekly Downloads

13

Version

0.2.1

License

ISC

Unpacked Size

5 kB

Total Files

5

Last publish

Collaborators

  • genoweb