import jwt , { SignOptions } from "jsonwebtoken" ; const generateToken = ( payload , options ) => new Promise ( ( resolve , reject ) => { jwt . sign ( payload , process . env . SECRET , options || { noTimestamp : true } , ( err , token ) => { if ( err ) { reject ( err ) ; } else { resolve ( token ) ; } } ) ; } ) ; const verifyToken = ( token ) => new Promise ( ( ( resolve , reject ) => { jwt . verify ( token , process . env . SECRET , ( err , decoded ) => { if ( err ) { reject ( err ) ; } else { resolve ( decoded ) ; } } ) ; } ) ) ; export { generateToken , verifyToken } ;