1.0.1 • Published 1 year ago

@mistflow/jwt-node v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

jwt-node

const JWTAuth = require('@mistflow/jwt-node')
const Config = require('@mistflow/jwt-node/src/config')

const config = new Config(
    'your-secret-key',
    'your-issuer', // optional
    'your-audience', // optional
    '1h', // token expiration time
)

const jwtAuth = new JWTAuth(config)
const token = jwtAuth.createToken(user)

const verify = jwtAuth.verifyToken(token)
console.log(verify.isValid) // verify.payload - for payload
1.0.1

1 year ago

1.0.0

1 year ago