0.0.6 • Published 8 months ago

vv-jwt v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

vv-jwt, simple creator and checker jwt

License

MIT

Install

npm i vv-jwt

Example

import { Create as CreateJwtManager } from 'vv-jwt'
const jwtManager = CreateJwtManager({
    secret: 'my secret',
    issDefault: 'my application',
    expDelta: 1000 * 60 * 60 *24,   //create tokens with one day life
})
// create token
const j = jwtManager.create()
if (j.error) {
    console.error(j.error)
} else {
    console.log(`token - ${j.jwtString}`)
}

// check token
const c = jwtManager.check(j.jwtString)
if (c.deny) {
    console.log(`NO SUCCESS CHECK TOKEN: ${c.deny.code} - ${c.deny.message}`)
} else {
    console.log(c.jwt)
}
0.0.6

8 months ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.1

2 years ago