0
if(req.cookies.token_name) {
    try {
        const decoded = await promisify(jwt.verifiy)(req.cookies.token_name, 
        process.env.jwtsecret);
        console.log(decoded);
    } 
    
    catch (error) {
        console.log(error);
    }
}

This is the bit I'm having problems with. It doesn't log the decoded variable but it also doesn't give any errors. Can anyone help me with this?

kaPa
  • 87
  • 10
  • 1
    Are you calling in an asynchronous context? On a separate topic, you should use `console.error` when printing error data. On linux stdout is buffering and your process may exit (crash) before writing, stderr is non-buffering and will write immediately. – leitning Jun 30 '21 at 15:58

1 Answers1

1

I think you have a typo in your function name, although it's hard to tell without seeing your import/require statements. verifiy should be verify.

const decoded = await promisify(jwt.verify)(req.cookies.token_name, ...);
Steven
  • 91
  • 3