Skip to content

Instantly share code, notes, and snippets.

View Mohan1203's full-sized avatar
💭
I may be slow to respond.

MohanDhila Mohan1203

💭
I may be slow to respond.
View GitHub Profile
@ziluvatar
ziluvatar / token-generator.js
Last active October 24, 2024 04:26
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');