Update README.md example since `var token` is already defined
See original GitHub issueI copy and pasted the example
// sign with default (HMAC SHA256)
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');
// sign with RSA SHA256
var cert = fs.readFileSync('private.key'); // get private key
var token = jwt.sign({ foo: 'bar' }, cert, { algorithm: 'RS256'});
// sign asynchronously
jwt.sign({ foo: 'bar' }, cert, { algorithm: 'RS256' }, function(err, token) {
console.log(token);
});
And noticed an error since var token
is already defined. Do you want me to send you a PR to update the example code? Can we use const
?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Update versions contained in README on maven release
This means you need to replace that token before the release, commit the changes, push it and rollback the file to the token....
Read more >init/README.md
Set the environment variable name to value in the launched process. Set shutdown behavior of the service process. When this is not specified,...
Read more >Git clone using gitlab-ci-token fails (authentication error) with ...
When I try to clone a git repo (automatically or manually) using http and gitlab-ci-token, this error message appears: Cloning into ...
Read more >Source of README.md - test-scripts - CEF Digital Code Server
IMPORTANT REMARKS: Test-Script is a sample code to help Early Adopters ... API if the SIOP token is not defined (see using token...
Read more >Managing Composer Github access with Personal Access ...
Go to https://github.com/settings/tokens and generate a new token. Generate GitHub Token. You will need to specify all repo scopes. Select ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @joshunger , merged!
See PR https://github.com/auth0/node-jsonwebtoken/pull/461