fake-api-jwt-json-server icon indicating copy to clipboard operation
fake-api-jwt-json-server copied to clipboard

function verifyToken return error not throw it

Open Pavel-Evdokimov opened this issue 6 years ago • 0 comments

Hi! When I try to get access to fake-api with this get request GET http://localhost:3000/products Authorization: Bearer I get all the data. But I think I shouldn't. I expecting to get an error "jwt must be provided". I guess code should be corrected some how like this let verifyTokenResult; try { verifyTokenResult = verifyToken(req.headers.authorization.split(' ')[1]); if (verifyTokenResult instanceof Error) { throw verifyTokenResult; } next()

Pavel-Evdokimov avatar Jan 27 '19 17:01 Pavel-Evdokimov