|
|
@@ -36,7 +36,7 @@ const INDEX_FILE = path.join(POSTS_DIR, 'index.json');
|
|
|
|
|
|
// Middleware
|
|
|
app.use(cors({
|
|
|
- origin: process.env.FRONTEND_URL || 'http://localhost:5173', // Frontend URL
|
|
|
+ origin: ['http://localhost:5173', 'https://goonblog.thevakhovske.eu.org'],
|
|
|
credentials: true // Enable cookies
|
|
|
}));
|
|
|
app.use(express.json());
|
|
|
@@ -57,11 +57,11 @@ app.use(session({
|
|
|
saveUninitialized: false,
|
|
|
name: 'gooneral-session',
|
|
|
cookie: {
|
|
|
- secure: process.env.COOKIE_SECURE === 'true' || process.env.NODE_ENV === 'production',
|
|
|
- httpOnly: true,
|
|
|
- maxAge: 24 * 60 * 60 * 1000, // 24 hours
|
|
|
- sameSite: process.env.COOKIE_SAME_SITE || (process.env.NODE_ENV === 'production' ? 'strict' : 'lax')
|
|
|
- }
|
|
|
+ secure: true, // HTTPS required
|
|
|
+ httpOnly: true,
|
|
|
+ maxAge: 24 * 60 * 60 * 1000, // 24 hours
|
|
|
+ sameSite: 'lax' // Changed from 'strict' to 'lax'
|
|
|
+}
|
|
|
}));
|
|
|
|
|
|
// Ensure posts directory exists
|