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

Use own interface for Socket request to allow extending the request interface independently of Express. #4787

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Aug 7, 2023

  1. use own interface for Socket request to allow extending the interface…

    … with custom properties without polluting the IncomingMessage type which is also used by Express/Passport
    
    Using socket.io with passport middlewares causes issues when using the same 'userProperty' key for both - by extending IncomingMessage { user: Express.user } we break passport's isAuthenticated() function which returns never in the else case since the IncomingMessage always has a user property on itself. To fix this, I believe we should be able to extend only the request type inside socket.io -> SocketRequest.
    alesmenzelsocialbakers committed Aug 7, 2023
    Configuration menu
    Copy the full SHA
    a0da6c2 View commit details
    Browse the repository at this point in the history