auth0-node-jwks-rs256 icon indicating copy to clipboard operation
auth0-node-jwks-rs256 copied to clipboard

Redundant code

Open ArthurZC23 opened this issue 5 years ago • 1 comments

When throwing an error in the getJwks method because the status code isn't right, we have the following argument for the JwksError: res.body && (res.body.message || res.body) || res.statusMessage || Http Error ${res.statusCode}``.

By set logic res.body && (res.body.message || res.body) will always be res.body. Therefore, either (res.body.message || res.body) is not necessary or we should change one of the logic operators.

ArthurZC23 avatar May 29 '19 16:05 ArthurZC23

I don't believe this is redundant, e.g.:

res = { body: {} }
res.body && (res.body.message || res.body)
//{}
res = { body: { message: 'hello' } }
res.body && (res.body.message || res.body)
//"hello"

afhole avatar Aug 13 '19 16:08 afhole