tfk-generate-jwt
v2.0.1
Published
Generate jwt-token
Downloads
5
Readme
tfk-generate-jwt
Generate jwt-token
Installation
$ npm i tfk-generate-jwt
Usage
const generateToken = require('tfk-generate-jwt')
const secret = 'NeverShareYourSecret'
const payload = {
name: 'zrrrzt',
description: 'general nice guy'
}
const options = {
expiresIn: '1h',
issuer: 'https://auth.t-fk.no'
}
const token = generateToken({key: secret, payload: payload, options: options})
console.log(token)
//Options are optional
const tokenWithoutOptions = generateToken({key: secret, payload: payload})
console.log(tokenWithoutOptions)