0.2.1 • Published 5 years ago
temp-token v0.2.1
temp-token
Installation
Install it using npm :
$ npm install temp-tokenOr install using yarn :
$ yarn add temp-tokenGetting 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 secondsCheck the token is valid :
token.checkToken("your_temp_token");
//if the token is valid, then it returns true
//otherwise it returns false