fix: disable saveUninitialized
This commit is contained in:
parent
6f3647a64b
commit
dfd0655042
@ -57,7 +57,7 @@ app.use(express.json());
|
||||
app.use(session({
|
||||
secret: process.env.SESSION_SECRET || 'your-secret-key-change-this',
|
||||
resave: false,
|
||||
saveUninitialized: true,
|
||||
saveUninitialized: false,
|
||||
rolling: true,
|
||||
cookie: {
|
||||
secure: process.env.NODE_ENV === 'production',
|
||||
@ -172,6 +172,7 @@ app.get('/debug/cookies', (req, res) => {
|
||||
// Vote submission endpoint
|
||||
app.post('/api/submit-vote', async (req, res) => {
|
||||
if (!req.isAuthenticated()) {
|
||||
console.error('User not authenticated');
|
||||
return res.status(401).json({ error: 'Must be logged in to vote' });
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user