@exogamy/jwt-easy
v1.0.0
Published
Simplified JWT with refresh tokens and blacklisting
Downloads
80
Maintainers
Readme
jwt-easy
Simplified JWT authentication with built-in refresh tokens and blacklisting.
Install
npm install jwt-easy
API
sign(payload, secret, expiresIn) verify(token, secret) decode(token)
generateRefreshToken(userId, expiresIn) verifyRefreshToken(token) rotateRefreshToken(oldToken, userId) revokeRefreshToken(token) revokeAllRefreshTokens(userId)
isExpired(token) getRemainingTime(token) addToBlacklist(token, expiresIn) isBlacklisted(token)
generateSecret(length) parseToken(authHeader) extractFromRequest(req)
License
MIT
