amrav / restify-jwt

restify middleware that validates a JsonWebToken (JWT) and sets the req.user with the attributes
Other
83 stars 30 forks source link

Added restify-errors to support last version of restify #15

Closed cuxs closed 4 years ago

cuxs commented 7 years ago

With the new version of restify, Errors, which used to be available on the restify.errors namespace, now live in their own repository and are published independently on npm. restify-errors can be used independently of restify in any of your other projects for customizable error classes and chained errors.

Now errors creation are updated.

jakegavin commented 7 years ago

I'm running into the same issue trying to upgrade to Restify 5 so I'd also like to see this get merged in.

Two things:

cuxs commented 7 years ago

Hmm a weird error appears now, I'll check them after working hours.

jakegavin commented 7 years ago

I don't fully understand the details but it sounds like those failing tests were because restify-jwt was reading from a private field we_cause which was changed to jse_cause. The public api is the .cause() method. Details: https://github.com/joyent/node-verror/issues/37

I needed this at work so I have a fork where I got these tests passing: https://github.com/jakegavin/restify-jwt/tree/restify-5 Let me know if you want me to PR that.

cuxs commented 7 years ago

Yes go ahead!