Open rajinder-yadav opened 2 years ago
I didn't dig into this issue too deeply, but I just converted it using a standard Promise
.
const verifyPromised = promisify(jsonwebtoken.verify.bind(jsonwebtoken));
becomes
export const verifyJWT = (token: string, publicKey: string) => new Promise((res, rej) => {
jsonwebtoken.verify(token, publicKey, (err, decoded) => {
if(err) rej(err)
res(decoded)
})
})
Does the ts code actually work? I tired to fix it but no luck.