skyturkish / divine-boost

A service website where players can move their accounts to the top leagues in exchange for money in various games.
https://elo-boost-7-frontend-luvjvoipkq-ew.a.run.app/
MIT License
0 stars 1 forks source link

while google gloud run deploy, authenticated user will be gone after refresh page or something else #1

Closed skyturkish closed 1 year ago

skyturkish commented 1 year ago

after logging in, the user is not stored, if we refresh the page or request a user again, it returns null from the database.

skyturkish commented 1 year ago
app.use(
    session({
        secret: 'anything',
        store: MongoStore.create({
            mongoUrl: process.env.MONGODB_CONNECTION_STRING || 'mongodb://0.0.0.0:27017/game_elo_boost'
        }),
        resave: true,
        saveUninitialized: false,
        cookie: {
            maxAge: 14 * 24 * 60 * 60 * 1000,
            sameSite: process.env.NODE_ENV == 'production' && 'none', <-------- This will fix
            secure: process.env.NODE_ENV == 'production'
        }
    })
)