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 минут