MichielDeMey / express-jwt-permissions

:vertical_traffic_light: Express middleware for JWT permissions
MIT License
523 stars 37 forks source link

express-jwt 7.x switched from req.user to req.auth #85

Open francisdb opened 2 years ago

francisdb commented 2 years ago

express-jwt 7.x changed the default property from req.user to req.auth I guess this library could also by default start using that property? (major release)

see https://github.com/auth0/express-jwt#migration-from-v6

workaround for now is to set up the library with

import ejp from 'express-jwt-permissions'
const guard = ejp({
  requestProperty: 'auth'
})
chrisnurse commented 1 year ago

@francisdb - thank you so much. This workaround was successful for me.