-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chapter-03- express-jwt #147
Comments
Hi, I believe we need to do this: const requireSignin = () => expressJwt({ And in the user.routes.js apply () to requireSignin. router.route('/api/users/:userId') |
Hi @inatu , did you got the solution to this issue or still having any issues? |
With "express-jwt": "^8.4.1" Try adding algorithms as follows: const requireSignin = expressJwt({ The above approach worked for me. No need to convert authCtrl.requireSignin to a function. |
Hi @inatu , @JimmyJoggins and @wadewilsones , anyone of you please confirm me whether we are good to close this issue? |
Given the level of inactivity, I think probably yes. |
@inatu I am getting the exact same error. How did you resolve it ? |
webpack:///./server/controllers/auth.controller.js?:54 TypeError: express_jwt__WEBPACK_IMPORTED_MODULE_2___default(...) is not a function Node.js v18.16.0 |
Hi, import express jwt with a different syntaxt |
let { expressjwt: expressJwt } = require('express-jwt'); |
Hello,
It seems that this code broke at "express-jwt": "^7.7.0"
How could I modify this code to work on the the latest version
const requireSignin = expressJwt({
secret: config.jwtSecret,
userProperty: 'auth'
})
got the following error:
const requireSignin = express_jwt__WEBPACK_IMPORTED_MODULE_2___default()({
^
TypeError: express_jwt__WEBPACK_IMPORTED_MODULE_2___default(...) is not a function
at eval (webpack://user_backend/./server/controllers/auth.controller.js?:69:73)
at Object../server/controllers/auth.controller.js (/Users/natu/qingning_website/user_backend/dist/server.generated.js:29:1)
at webpack_require (/Users/natu/qingning_website/user_backend/dist/server.generated.js:243:41)
at eval (webpack://user_backend/./server/routes/user.routes.js?:8:86)
at Object../server/routes/user.routes.js (/Users/natu/qingning_website/user_backend/dist/server.generated.js:79:1)
at webpack_require (/Users/natu/qingning_website/user_backend/dist/server.generated.js:243:41)
at eval (webpack://user_backend/./server/express.js?:20:77)
at Object../server/express.js (/Users/natu/qingning_website/user_backend/dist/server.generated.js:49:1)
at webpack_require (/Users/natu/qingning_website/user_backend/dist/server.generated.js:243:41)
at eval (webpack://user_backend/./server/server.js?:3:66)
The text was updated successfully, but these errors were encountered: