Closed mkubdev closed 3 years ago
Again, solved myself 👍🏻 ! To save a session on your MongoDB Database, you could use connect-mongo
:
app.use(session({
// store: new FileStore({ path: './sessions' }),
store: MongoStore.create({ mongoUrl: process.env.MONGO_URI_LOCAL }),
secret: 'secret',
resave: true,
saveUninitialized: false,
cookie: {
maxAge: 2.628e+9, // 1 month
// sameSite: false,
// httpOnly: false,
// secure: false,
},
}));
Hello ricardo, thanks a lot for this repos. It really helped to build a nestjs SP app to auth an SAMLv2 authentication. First step with the ADFS IDP was successfull ! I can get back the profile with adfs's user informations.
But i have a question, do you already manage to save a session into mongodb with mongoose instead of FileStorage ? I'm struggling to find a good documentation about this niche.
Have a good day, thanks again!