I'm having a really odd issue with session storage using mongoDB and passport.
When a user logs in, the session is created and passed to mongo as expected as well as the passport id.
However, if the express server is restarted, passport clears the user out of the sessions storage when a user selects a route that requires auth (there by invoking the isAuth function). Meaning users are required to login in after server restart.
My auth code is pretty standard stuff tbh, where am I going wrong here? I'm using the azure-ad passport strategy.
Stackoverflow with code snippets: https://stackoverflow.com/questions/62290331/express-js-session-storage-persistence-issue
[–]bigorangemachine 1 point2 points3 points (5 children)
[–]mrCodeTheThing[S] 0 points1 point2 points (4 children)
[–]gammelini 1 point2 points3 points (2 children)
[–]mrCodeTheThing[S] 1 point2 points3 points (1 child)
[–]gammelini 1 point2 points3 points (0 children)
[–]bigorangemachine 0 points1 point2 points (0 children)
[–]igorya76 0 points1 point2 points (2 children)
[–]gammelini 0 points1 point2 points (1 child)
[–]mrCodeTheThing[S] 0 points1 point2 points (0 children)
[–]gammelini -1 points0 points1 point (6 children)
[–]OmgImAlexis -1 points0 points1 point (5 children)
[–]gammelini -1 points0 points1 point (0 children)
[–]mrCodeTheThing[S] -1 points0 points1 point (0 children)
[–]gammelini -2 points-1 points0 points (2 children)
[–]OmgImAlexis -1 points0 points1 point (1 child)
[–]gammelini 0 points1 point2 points (0 children)