1const jwt = require('jsonwebtoken');
2
3const jwt_secret = require('crypto').randomBytes(64).toString('hex');
4
5// preferably store and use jwt_secret as an environment variable rather than generating it at runtime
6jwt.sign({ _id: emailExist._id }, jwt_secret);