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:
@@ -2,6 +2,16 @@
|
||||
|
||||
Формат основан на [Keep a Changelog](https://keepachangelog.com/ru/1.1.0/), версии — [SemVer](https://semver.org/lang/ru/).
|
||||
|
||||
## [1.0.8] — 2026-09-17
|
||||
|
||||
### CMS
|
||||
|
||||
- Исправлена сессия входа в админку по HTTP: cookie больше не отбрасывается из‑за Origin/CSRF
|
||||
|
||||
### Сайт
|
||||
|
||||
- Cookie входа в личный кабинет сохраняется на HTTP без флага Secure
|
||||
|
||||
## [1.0.7] — 2026-09-17
|
||||
|
||||
### CMS
|
||||
@@ -70,6 +80,7 @@
|
||||
- Docker Compose для локальной БД
|
||||
- Секреты и логины в git не входят
|
||||
|
||||
[1.0.8]: https://git.myunion.pro/Alex/Moniki_uslugi/src/tag/v1.0.8
|
||||
[1.0.7]: https://git.myunion.pro/Alex/Moniki_uslugi/src/tag/v1.0.7
|
||||
[1.0.6]: https://git.myunion.pro/Alex/Moniki_uslugi/src/tag/v1.0.6
|
||||
[1.0.5]: https://git.myunion.pro/Alex/Moniki_uslugi/src/tag/v1.0.5
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
Репозиторий: [Moniki_uslugi](https://git.myunion.pro/Alex/Moniki_uslugi) на [git.myunion.pro](https://git.myunion.pro/).
|
||||
|
||||
Текущая версия: **v1.0.7** (см. [CHANGELOG.md](CHANGELOG.md)).
|
||||
Текущая версия: **v1.0.8** (см. [CHANGELOG.md](CHANGELOG.md)).
|
||||
|
||||
## Что внутри
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@moniki/cms",
|
||||
"version": "1.0.7",
|
||||
"version": "1.0.8",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: 'Русский' },
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@moniki/web",
|
||||
"version": "1.0.7",
|
||||
"version": "1.0.8",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev -p 3000",
|
||||
|
||||
@@ -19,7 +19,7 @@ export async function POST(request: Request) {
|
||||
httpOnly: true,
|
||||
sameSite: "lax",
|
||||
path: "/",
|
||||
secure: process.env.NODE_ENV === "production",
|
||||
secure: false,
|
||||
maxAge: 60 * 60 * 24 * 7,
|
||||
});
|
||||
return response;
|
||||
|
||||
@@ -28,7 +28,7 @@ export async function POST(request: Request) {
|
||||
httpOnly: true,
|
||||
sameSite: "lax",
|
||||
path: "/",
|
||||
secure: process.env.NODE_ENV === "production",
|
||||
secure: false,
|
||||
maxAge: 60 * 60 * 24 * 7,
|
||||
});
|
||||
return response;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "moniki-platnye-uslugi",
|
||||
"version": "1.0.7",
|
||||
"version": "1.0.8",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "pnpm -r --parallel dev",
|
||||
|
||||
Reference in New Issue
Block a user