auth0-node-jwks-rs256
auth0-node-jwks-rs256 copied to clipboard
Redundant code
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.
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"