error using expressjwt : expressjwt is not a function

42 views Asked by At
const expressJwt = require('express-jwt')


function authJwt(){
    const secret= process.env.secret;
    return expressJwt({
        secret,
        algorithms: ['HS256']
    })
}

module.exports = authJwt;

i tried replacing expressJwt with {expressJwt},{expressjwt:expressJwt} and other solution given earlier. I also tried a version older than 7 but it also didn't work.

0

There are 0 answers