Skip to content

Instantly share code, notes, and snippets.

View EduardoSaverin's full-sized avatar
:octocat:
Happy Code

Sumit Chaudhary EduardoSaverin

:octocat:
Happy Code
View GitHub Profile
@ziluvatar
ziluvatar / token-generator.js
Last active May 21, 2024 12:44
Example of refreshing tokens with jwt
/**
* Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken
* It was requested to be introduced at as part of the jsonwebtoken library,
* since we feel it does not add too much value but it will add code to mantain
* we won't include it.
*
* I create this gist just to help those who want to auto-refresh JWTs.
*/
const jwt = require('jsonwebtoken');