Questions tagged [mongostore]
4 questions
1
vote
1 answer
Passport: fail to initialize MongoStore
I am trying to follow the example given here:
const mongoose = require("mongoose");
const session = require("express-session");
const MongoStore = require("connect-mongo")(session);
but this fails immediately with:
ServerMiddleware Error: Class…

Marc
- 1,812
- 4
- 23
- 36
0
votes
0 answers
passport session authentication works on postman but it breaks in client (Node Js & React Js)
I'm trying to login with passport session exrpess and mongodb, the problem is that it's not working on the client side (my session is created correctly even from the client, but when I have to enter a protected route the req.user returns undefined)…
0
votes
1 answer
express-session with MongoStore working in Postman but not working in browser
I am using MongoStore to store session.
Following snippet initializes the usage of express-session and MongoStore
import session from "express-session";
import MongoStore from "connect-mongo";
app.use(session({
secret: env.SESSION_SECRET,
…

Goofy Programmer
- 3
- 3
0
votes
0 answers
Every API request makes 2 new Express Sessions, only keeping the second one for passing to the router once (MongoDB, Express Sessions, Node,Javascript
Im trying to initialize an express session to a Mongo store in my MERN application for passing a user's ID to my passport authentication flow, however it acts unaccordingly to how it should by my understanding.
For each request i make to my…