description |
---|
Encodes/decodes JWTs |
Param | Type | Default |
---|---|---|
[secret] | string |
process.env.JWT_SECRET |
[algorithm] | string |
"HS256" |
- instance
- .encode(subject, expiresIn, [payload]) ⇒
Promise.<string>
- .decode(token, [options]) ⇒
Promise.<{}>
- .encode(subject, expiresIn, [payload]) ⇒
Creates a JWT.
Kind: instance method of EnvoyJWT
Param | Type | Description |
---|---|---|
subject | string | number | null |
|
expiresIn | string | number | null |
seconds or string like: https://github.com/zeit/ms |
[payload] | Object |
Kind: instance method of EnvoyJWT
Param | Type |
---|---|
token | string |
[options] | JWTOptions |
https://www.npmjs.com/package/jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback