From dd6058881c4227584c327b626cfadc15a7902e4f Mon Sep 17 00:00:00 2001 From: kilyabin <65072190+kilyabin@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:42:04 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B0=20TypeScript=20=D0=BE=D1=88=D0=B8?= =?UTF-8?q?=D0=B1=D0=BA=D0=B0=20=D0=B8=20=D1=83=D0=BB=D1=83=D1=87=D1=88?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA=20=D1=81?= =?UTF-8?q?=D0=B1=D0=BE=D1=80=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Исправлена TypeScript ошибка в login.ts: добавлено поле retryAfter в тип ResponseData - Улучшена обработка ошибок в manage.sh: добавлена проверка успешности сборки перед проверкой standalone директории - Предупреждение о missing standalone директории теперь выдает ошибку с подробным описанием --- scripts/manage.sh | 11 +++++++++-- src/pages/api/admin/login.ts | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/manage.sh b/scripts/manage.sh index 8d3c76a..64c4549 100755 --- a/scripts/manage.sh +++ b/scripts/manage.sh @@ -176,7 +176,11 @@ case "$1" in # Build echo -e "${YELLOW}Building application...${NC}" - npm run build + if ! npm run build; then + echo -e "${RED}Build failed! Please check the error messages above.${NC}" + echo -e "${RED}The .next/standalone directory will not be created if the build fails.${NC}" + exit 1 + fi # Ensure public directory and static files are accessible in standalone build echo -e "${YELLOW}Setting up static files...${NC}" @@ -195,7 +199,10 @@ case "$1" in echo -e "${RED}Warning: .next/static directory not found!${NC}" fi else - echo -e "${RED}Warning: .next/standalone directory not found!${NC}" + echo -e "${RED}Error: .next/standalone directory not found!${NC}" + echo -e "${RED}This usually means the build failed or output: 'standalone' is not configured correctly.${NC}" + echo -e "${RED}Please check next.config.js and ensure the build completed successfully.${NC}" + exit 1 fi # Set ownership diff --git a/src/pages/api/admin/login.ts b/src/pages/api/admin/login.ts index b9d42bb..6b4881f 100644 --- a/src/pages/api/admin/login.ts +++ b/src/pages/api/admin/login.ts @@ -4,6 +4,7 @@ import { verifyPassword, setSessionCookie } from '@/shared/utils/auth' type ResponseData = { success?: boolean error?: string + retryAfter?: number } // Rate limiting: 5 попыток в 15 минут