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