0.2.1 • Published 3 years ago
temp-token v0.2.1
temp-token
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