question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update README.md example since `var token` is already defined

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ziluvatarcommented, Apr 26, 2018

Thanks @joshunger , merged!

0reactions
joshungercommented, Apr 18, 2018
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found