Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set session ID when setting next #403

Merged
merged 1 commit into from Jul 29, 2018

Conversation

joearasin
Copy link
Contributor

Addresses #401.

It may make sense to refactor the "login session" code so that this doesn't need to be a repeated issue throughout the code.

@alanhamlett
Copy link
Collaborator

Cool, looks good but why not use your newer test that's easier to read? #401 (comment)

@joearasin
Copy link
Contributor Author

Unfortunately this fails the newer test (I think). This fixes the problem by ensuring that _id is set when next is set, which keeps the session intact.

@joearasin
Copy link
Contributor Author

joearasin commented Jul 29, 2018

Basically, there are two ways to fix the bug:

  1. Ensure _id is set when next is set, which means the session protection won't fire
  2. When the session protection does fire, don't trash the 'next'

This solves it with option 1, and the test will succeed with either solution. The shorter test is a unit test for option 2.

@alanhamlett alanhamlett merged commit 0d3a6a9 into maxcountryman:master Jul 29, 2018
@singingwolfboy singingwolfboy mentioned this pull request Jun 5, 2019
3 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants