Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🔧 Ticket in Trello.
We've wanted to bump the passport version in use for auth routes for some time, because
0.6.0
fixes a 'moderate' security vulnerability (as flagged by dependabot 2 years ago).But this version throws up a bug related to our use of
cookie-session
, whichpassport
does not commit to being compatible with (see here) (it only claims to supportexpress-session
). The issue is that passport used to implement thereq.session.regenerate
andreq.session.save
methods, which are called bycookie-session
, but no longer does.So in this PR we jump to
0.7.0
(changelog), and implement a fix for this bug by stubbing out dummy methods onreq.session
. Credit to this comment in passport#904 for the fix.Supertest does not make the
request
objection available for testing - only theresponse
. Therefore in order to test things about the request we are actually constructing, I added a new module with a dedicated test route. Very open to other ideas on how to test these dummy methods if that doesn't seem best practice :)