add missing unit tests for #2108 - #2227
Conversation
subsequent token middleware tries to read `token.id` when `enableDoublecheck: true`. That caused a "Cannot read property `id` of `null`" error when the first middleware didn't actually find a valid accessToken.
|
Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test." |
|
@slnode ok to test |
| .expect(200) | ||
| .end(function(err, res) { | ||
| if (err) return done(err); | ||
| expect(res.body).to.eql({ |
There was a problem hiding this comment.
Is it necessary to check all token properties here? I am worried that if we add a new Token property in the future, we will have to fix way too many tests that don't really depend on specific Token properties.
It think it is enough to check that res.body.id is the same as token.id, isn't it?
There was a problem hiding this comment.
in my last unit test, I did exactly that - and you commented that only checking on id wouldn't be enough.
Let me know which one you prefer
There was a problem hiding this comment.
I see, sorry for me not being consistent! Let's keep what you have now.
|
@benkroeger thank you for the pull request. The patch looks good in general, I pointed out two details to improve in the comments above. |
|
Landed via 103935c, thank you for the contribution! |
Subsequent token middleware tries to read `token.id` when `enableDoublecheck: true`. That caused a "Cannot read property `id` of `null`" error when the first middleware didn't actually find a valid accessToken. [back-port of #2227]
subsequent token middleware tries to read
token.idwhenenableDoublecheck: true. That caused a "Cannot read propertyidofnull" error when the first middleware didn't actually find a valid accessToken.@bajtos
fixes #2226