Skip to content

Instantly share code, notes, and snippets.

@alavers
Last active May 29, 2017 02:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alavers/8f07b03895333d83b454 to your computer and use it in GitHub Desktop.
Save alavers/8f07b03895333d83b454 to your computer and use it in GitHub Desktop.
var jwt = require('jsonwebtoken');
// Generate your own secret key for your app here https://app.supportkit.io
var KEY_ID = '55e9f9bf7a0ce5ca2d429c17';
var SECRET = 'BFJJ88naxc5PZNAMU9KpBNTR';
var signJwt = function(userId) {
return jwt.sign({
scope: 'appUser',
userId: userId
},
SECRET,
{
header: {
kid: KEY_ID
}
});
}
@AhmadIbrahiim
Copy link

i get -> jwt is malformed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment