Created
July 24, 2020 10:33
-
-
Save akumbhani66/95b2837f549060d4671d92057a9703af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const jwt = require('jwt-simple'); | |
const payload = { | |
"this is": "simple payload" | |
} | |
const secret = 'top-secret@2020'; | |
// encode | |
const token = jwt.encode(payload, secret); | |
console.log(">>>>>", token); | |
// decode | |
const decoded = jwt.decode( | |
token, | |
secret | |
); | |
console.log(decoded); //=> { "this is": "simple payload" }% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment