mirror of
https://github.com/hanzoai/node-jsonwebtoken.git
synced 2026-09-24 17:00:48 +00:00
fix doc issue - closes #213
This commit is contained in:
@@ -26,7 +26,7 @@ encoded private key for RSA and ECDSA.
|
||||
|
||||
`options`:
|
||||
|
||||
* `algorithm` or `alg` (default: `HS256`)
|
||||
* `algorithm` (default: `HS256`)
|
||||
* `expiresIn`: expressed in seconds or a string describing a time span [rauchg/ms](https://github.com/rauchg/ms.js). Eg: `60`, `"2 days"`, `"10h"`, `"7d"`
|
||||
* `notBefore`: expressed in seconds or a string describing a time span [rauchg/ms](https://github.com/rauchg/ms.js). Eg: `60`, `"2 days"`, `"10h"`, `"7d"`
|
||||
* `audience`
|
||||
@@ -52,7 +52,7 @@ Example
|
||||
var jwt = require('jsonwebtoken');
|
||||
var token = jwt.sign({ foo: 'bar' }, 'shhhhh');
|
||||
//backdate a jwt 30 seconds
|
||||
var older_token = jwt.sign({ foo: 'bar', iat: Math.floor(Date.now() / 1000) - 30 }, 'shhhhh');
|
||||
var older_token = jwt.sign({ foo: 'bar', iat: Math.floor(Date.now() / 1000) - 30 }, 'shhhhh');
|
||||
|
||||
// sign with RSA SHA256
|
||||
var cert = fs.readFileSync('private.key'); // get private key
|
||||
|
||||
Reference in New Issue
Block a user