Two sessions being saved to store #955
Unanswered
averybuehler
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to implement session-based authentication in Nest.js using Passport.js and I've run into an issue. For reference, I'm using
pg-connect-simple
to configure the store with PostgreSQL.I have this route:
What I see in the console is this:
This is what gets stored in the database:
I don't understand why
request.sessionID
is changing, and that's the root of my issue. The session with the id ofNWdZEuZFqg4tWoQKPMHOW6BjNE9Y-3ML
gets returned to the client and is not logged in. The session with the id ofOBoHcDJkAIRTCQh0yM1TrRlUc6TKrnsY
, however, is logged in but is never sent to the client (because the first session was). I don't understand why the session id is changing because it's not allowing me to authenticate the user upon registering.The ideal behavior is for only one session to be created, for that session to be logged in, and for that session to be returned to the client.
Does anyone have any insight into what might be causing this? I've been troubleshooting forever but can't find any solutions.
Beta Was this translation helpful? Give feedback.
All reactions