You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am creating a chat app with websockets and want to use req.user within websocket event listener handlers. Using a simple passport.authenticate('local') works fine and populates req.user in later requests as expected. However, I want to provide an AuthenticationCallback to send a variable JSON message back to my React frontend on login success/failure rather than just a 401 status. User information is retrieved successfully but later requests do not deserialize. Downgrading to 0.5.3 fixes the issue.
Expected behavior
req.user is populated through deserialization on requests after authorization
Actual behavior
req.user is undefined on requests after authorization
I am creating a chat app with websockets and want to use req.user within websocket event listener handlers. Using a simple passport.authenticate('local') works fine and populates req.user in later requests as expected. However, I want to provide an AuthenticationCallback to send a variable JSON message back to my React frontend on login success/failure rather than just a 401 status. User information is retrieved successfully but later requests do not deserialize. Downgrading to 0.5.3 fixes the issue.
Expected behavior
req.user is populated through deserialization on requests after authorization
Actual behavior
req.user is undefined on requests after authorization
Steps to reproduce
Route:
My passport configuration:
My websocket (logs undefined on 0.7.0, logs correctly on 0.5.3):
Environment
The text was updated successfully, but these errors were encountered: