Closed dennismckinnon closed 9 years ago
Bad form to complicate the PR but its such a simple fix I figured I would tack it on rather then make a second one.
Noticed that errors from jwt.decode were not caught. If token was corrupted and unable to be decoded this would result in a 500 internal error. Now it throws the more appropriate invalid credentials error.
@dennismckinnon This isn't what restify-jwt is intended to do. See #2. Your use case is implemented as custom middleware after restify-jwt.
I found I wanted to specially format the token payload and parse it properly when being submitted so I added the ability to pass a processPayload function which runs on decoded token payload. This is not a big change.