1.0.23 • Published 3 years ago
@buuhv/jwt-js v1.0.23
@buuhv/jwt-js
JWT is a service class to your manage the sessions of your application
Getting started
npm install @buuhv/jwt-js --save
Usage
import JWT from '@buuhv/jwt-js';
const jwtService = new JWT('SECRET_KEY', 'ISS');
//expires is optional and you can use any value inside object
const newToken = jwtService.register({
expires: new Date().getTime() 'optional'
'OBJECT DATA'
});
const isValid = jwtService.checkJWT('OBJECT WITH HEADERS OF REQUEST');
if (isValid.status === false) console.log(isValid.message);
const jwtData = jwtService.data('OBJECT WITH HEADERS OF REQUEST');
if (jwtData.status === true) console.log(jwtData.data);
if (jwtData.status === false) console.log(jwtData.message);
Request Object with Headers Example
req: {
headers: {
Authorization|authorization: 'Bearer ....'
};
}
Contributors
This module was extracted from Crypto-Js
core. Please reffer to https://github.com/geeknection/jwt-js/contributors for the complete list of contributors.
License
The library is released under the MIT licence. For more information see LICENSE
.
1.0.22
3 years ago
1.0.21
3 years ago
1.0.20
3 years ago
1.0.23
3 years ago
1.0.19
4 years ago
1.0.17
4 years ago
1.0.16
4 years ago
1.0.15
4 years ago
1.0.14
4 years ago
1.0.13
4 years ago
1.0.11
4 years ago
1.0.12
4 years ago
1.0.10
4 years ago
1.0.9
4 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago