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

No monkeypatch #848

Merged
merged 9 commits into from
Sep 23, 2021
Merged

No monkeypatch #848

merged 9 commits into from
Sep 23, 2021

Conversation

jaredhanson
Copy link
Owner

This PR removes the monkey patching of node's http.IncomingMessage. Instead of that, it adds methods to each request as it passes through middleware, in a way that fits the patterns in other Express middleware.

In addition to that, session internals have been refactored to operate on req.session directly, rather than a pointer maintained at req._passport.session. This is part of an ongoing effort to refactor away from req._passport and clean up internals which use that.

For those same reasons, use of this._passport.instance._userProperty has been refactored to req._userProperty. This cleans up internals while also allowing the possibility of setting a custom user property per-request via middleware, rather than globally for all requests processed through the singleton Passport instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant