express-jwt icon indicating copy to clipboard operation
express-jwt copied to clipboard

ES6 Import Not Working

Open Tarekrahman5500 opened this issue 3 years ago • 0 comments

import {expressjwt} from "express-jwt";

// create function that prevent un auth login to access the api

function authJwt() {
    const secret = process.env.SECRET_KEY;
    const api = process.env.API_URL;
    return expressjwt({
        secret,
        algorithms: ['HS256']

    }).unless({
        path: [
            'api/v1/users/login'
        ]
    })
}
module.exports = authJwt

when use

var { expressjwt: jwt } = require("express-jwt");
 return jwt({))

work fine but i need in es6 the code work fine when not use es6 import style express-jwt": "^7.7.5 xpress": "^4.18.1 node-16.15 os-windows 11

Tarekrahman5500 avatar Jul 28 '22 20:07 Tarekrahman5500