Keep HTTP admin and cabinet sessions by not requiring Secure cookies or Origin CSRF.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alexey Novikov
2026-09-17 01:13:19 +03:00
co-authored by Cursor
parent 4dbfe782f5
commit a6a748281f
9 changed files with 20 additions and 9 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@moniki/cms",
"version": "1.0.7",
"version": "1.0.8",
"private": true,
"type": "module",
"scripts": {
+1 -2
View File
@@ -8,8 +8,7 @@ export const Users: CollectionConfig = {
tokenExpiration: 60 * 60 * 24 * 7,
cookies: {
sameSite: 'Lax',
// HTTP admin (IP:3001) cannot store Secure cookies; enable only on HTTPS.
secure: (process.env.NEXT_PUBLIC_SERVER_URL || '').startsWith('https://'),
secure: false,
},
},
admin: {
+2 -1
View File
@@ -114,7 +114,8 @@ export default buildConfig({
}),
sharp,
cors: allowedOrigins,
csrf: allowedOrigins,
// Empty list: do not drop the session cookie when Origin is missing or atypical (HTTP IP:port admin).
csrf: [],
localization: {
locales: [
{ code: 'ru', label: 'Русский' },