From 14122f99e7dbf7ea7a7643398c49e60082269db5 Mon Sep 17 00:00:00 2001 From: Dmitrij Kolotusha Date: Tue, 17 Mar 2026 15:42:38 +0300 Subject: [PATCH 1/3] =?UTF-8?q?fix(api):=20=D1=83=D0=B1=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D1=8C=20=D0=BA=D0=BE=D0=BD=D1=84=D0=BB=D0=B8=D0=BA=D1=82=20?= =?UTF-8?q?=D1=81=20=D0=BF=D0=BE=D1=80=D1=82=D0=B0=D0=BC=D0=B8=20=D0=B2=20?= =?UTF-8?q?windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/api/src/main.ts | 2 +- turbo.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/api/src/main.ts b/apps/api/src/main.ts index 0f0e48ee..5aa959fc 100644 --- a/apps/api/src/main.ts +++ b/apps/api/src/main.ts @@ -16,7 +16,7 @@ async function bootstrap() { setupSwagger(app) - await app.listen(4000) + await app.listen(process.env.PORT ?? 3000) } void bootstrap() diff --git a/turbo.json b/turbo.json index 10cac16c..77563396 100644 --- a/turbo.json +++ b/turbo.json @@ -13,7 +13,7 @@ "dev": { "cache": false, "persistent": true, - "env": ["DATABASE_URL"] + "env": ["DATABASE_URL", "PORT"] }, "build": { "dependsOn": ["^build"], From b52b2b3f5d77c09f807278c21c0842b5e1a9059b Mon Sep 17 00:00:00 2001 From: Dmitrij Kolotusha Date: Tue, 17 Mar 2026 15:44:45 +0300 Subject: [PATCH 2/3] =?UTF-8?q?chore(docs):=20=D0=B8=D1=81=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=B8=D1=82=D1=8C=20=D0=B4=D0=BE=D0=BA=D1=83=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D1=82=D0=B0=D1=86=D0=B8=D1=8E=20=D1=81=20=D0=BF?= =?UTF-8?q?=D0=BE=D1=80=D1=82=D0=B0=D0=BC=D0=B8=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D1=84=D1=80=D0=BE=D0=BD=D1=82=D0=B5=D0=BD=D0=B4=D0=B0=20=D0=B8?= =?UTF-8?q?=20=D0=B1=D1=8D=D0=BA=D0=B5=D0=BD=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/backend/README.md | 4 ++-- docs/backend/swagger/README.md | 6 +++--- docs/work/start.md | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/backend/README.md b/docs/backend/README.md index a1fcf360..bf686ed4 100644 --- a/docs/backend/README.md +++ b/docs/backend/README.md @@ -31,12 +31,12 @@ 1. **Запустить Redis** — `pnpm docker:redis-up` 2. **Настройка валидации** — [validation/setup](../validation/setup.md) -3. **Swagger** — http://localhost:4000/api/docs +3. **Swagger** — http://localhost:3000/api/docs 4. **Prisma Studio** — `pnpm prisma:studio` ## Реализованные эндпоинты -Актуальный список с описанием запросов/ответов — в Swagger: http://localhost:4000/api/docs +Актуальный список с описанием запросов/ответов — в Swagger: http://localhost:3000/api/docs ### Аутентификация (JWT + Cookie) diff --git a/docs/backend/swagger/README.md b/docs/backend/swagger/README.md index 692cff6d..d36e28c6 100644 --- a/docs/backend/swagger/README.md +++ b/docs/backend/swagger/README.md @@ -4,9 +4,9 @@ | URL | Описание | | ---------------------------------- | ------------ | -| http://localhost:4000/api/docs | Swagger UI | -| http://localhost:4000/swagger.json | OpenAPI JSON | -| http://localhost:4000/swagger.yaml | OpenAPI YAML | +| http://localhost:3000/api/docs | Swagger UI | +| http://localhost:3000/swagger.json | OpenAPI JSON | +| http://localhost:3000/swagger.yaml | OpenAPI YAML | ## Установка зависимостей diff --git a/docs/work/start.md b/docs/work/start.md index 2ae00a92..f4b612b6 100644 --- a/docs/work/start.md +++ b/docs/work/start.md @@ -133,8 +133,8 @@ pnpm dev Приложение будет доступно: -- Frontend (Web): http://localhost:3000 -- Backend (API): http://localhost:4000 +- Frontend (Web): http://localhost:3001 +- Backend (API): http://localhost:3000 ## Полезные команды From b09d459a5683c4f8712b68cc2faace5735da8da4 Mon Sep 17 00:00:00 2001 From: Dmitrij Kolotusha Date: Tue, 17 Mar 2026 15:54:39 +0300 Subject: [PATCH 3/3] =?UTF-8?q?fix(api):=20=20refresh=20token=20=D0=BE?= =?UTF-8?q?=D1=82=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D1=8F=D1=82=D1=8C=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BA=D0=BE=D1=80=D0=BD=D0=B5=D0=B2=D0=BE=D0=B9=20?= =?UTF-8?q?=D0=BF=D1=83=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/api/src/auth/auth.service.ts | 4 ++-- apps/web/proxy.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/api/src/auth/auth.service.ts b/apps/api/src/auth/auth.service.ts index 37f82001..70ef228b 100644 --- a/apps/api/src/auth/auth.service.ts +++ b/apps/api/src/auth/auth.service.ts @@ -132,7 +132,7 @@ export class AuthService { } } - this.setCookie(res, 'refreshToken', '', new Date(0), '/auth/refresh') + this.setCookie(res, 'refreshToken', '', new Date(0), '/') this.setCookie(res, 'accessToken', '', new Date(0), '/') return { message: 'Пользователь успешно вышел', success: true } @@ -162,7 +162,7 @@ export class AuthService { 'refreshToken', refreshToken, new Date(Date.now() + parseTTLToMs(this.COOKIE_TTL)), - '/auth/refresh', + '/', ) this.setCookie( diff --git a/apps/web/proxy.ts b/apps/web/proxy.ts index 0c65fb66..7424d972 100644 --- a/apps/web/proxy.ts +++ b/apps/web/proxy.ts @@ -9,14 +9,15 @@ import { NextResponse, type NextRequest, type ProxyConfig } from 'next/server' export function proxy(request: NextRequest) { const { pathname, search } = request.nextUrl const accessToken = !!request.cookies.get('accessToken')?.value + const refreshToken = !!request.cookies.get('refreshToken')?.value - if (!accessToken && isProtectedRoute(pathname)) { + if (!refreshToken && isProtectedRoute(pathname)) { const url = new URL(ROUTES.login, request.url) url.searchParams.set(ROUTE_QUERY_PARAMS.from, `${pathname}${search}`) return NextResponse.redirect(url) } - if (accessToken && isAuthRoute(pathname)) { + if ((accessToken || refreshToken) && isAuthRoute(pathname)) { return NextResponse.redirect(new URL(ROUTES.teams, request.url)) }