
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
jwt-destroy
Advanced tools
JWT-Destroy is an enhanced version of the popular JSONWebToken npm package. It extends its functionality by offering manual expiry control, allowing developers to easily manage token expiration within their applications. With JWT-Destroy, you have more fl
JWT-Destroy is a powerful superset of the popular jsonwebtoken npm package. It provides seamless integration with jsonwebtoken's features, allowing you to effortlessly generate and verify tokens. Additionally, with manual token expiry capabilities, JWT-Destroy empowers you with precise control over token lifetimes.
npm install jwt-destroy@latest # Install the latest version
const {jwt} = require('jwt-destroy');
// Register a secret key
const Operation = new jwt('secret'); // secret is the secret key by default if not provided
// Generate a token
const token = Operation.generate({id: 1, name: 'John Doe'}, '1h'); // 1h is the expiry time by default if not provided
// Generate a Login token
const token = Operation.generateLoginToken({id: 1, name: 'John Doe'}, 5, '1h'); // 1h is the expiry time by default if not provided
// Verify a token
const payload = Operation.decode(token); // Returns the payload if the token is valid, else returns a object with error message
// Destroy a token
Operation.destroy(token); // Destroys the token if it is valid & return a new Destroyed JWT object, else returns a object with error message
const {jwt} = require('jwt-destroy');
// Register a secret key
const operation = new jwt('secret'); // secret is the secret key by default if not provided
// Generate a token
const token = await operation.generate({id: 1, name: 'John Doe'}, '1h'); // 1h is the expiry time by default if not provided
// Verify a token
const payload = await operation.decode(token); // Returns the payload if the token is valid, else returns a object with error message
// Destroy a token
const destroyedToken = await operation.destroy(token); // Destroys the token if it is valid & return a new Destroyed JWT object, else returns a object with error message
FAQs
JWT-Destroy is an enhanced version of the popular JSONWebToken npm package. It extends its functionality by offering manual expiry control, allowing developers to easily manage token expiration within their applications. With JWT-Destroy, you have more fl
We found that jwt-destroy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.