From 85afe2badc96cf2b7c0fdc359507d13c9a25d948 Mon Sep 17 00:00:00 2001 From: din9xtr Date: Thu, 15 Jan 2026 05:12:34 +0700 Subject: [PATCH] fix healthckeck logging --- .gitattributes | 2 ++ src/Controllers/AuthController.php | 1 - src/Middlewares/AuthMiddleware.php | 11 +++++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..c6c3f94 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Vendored / third-party libraries +public/js/tus.js linguist-vendored diff --git a/src/Controllers/AuthController.php b/src/Controllers/AuthController.php index 499514d..df1f6db 100755 --- a/src/Controllers/AuthController.php +++ b/src/Controllers/AuthController.php @@ -22,7 +22,6 @@ final readonly class AuthController public function loginForm(): string { - $this->logger->info("Login form started"); $error = $_SESSION['login_error'] ?? null; unset($_SESSION['login_error']); diff --git a/src/Middlewares/AuthMiddleware.php b/src/Middlewares/AuthMiddleware.php index c6f89c9..252d3a7 100755 --- a/src/Middlewares/AuthMiddleware.php +++ b/src/Middlewares/AuthMiddleware.php @@ -37,9 +37,16 @@ final class AuthMiddleware implements MiddlewareInterface RequestHandlerInterface $handler ): ResponseInterface { - $this->logger->debug('getClientIp: ' . getClientIp()); - + $clientIp = getClientIp(); $path = $request->getUri()->getPath(); + $method = $request->getMethod(); + + if ($clientIp !== '::1') { //todo trusted proxy + $this->logger->debug( + sprintf('Request: %s %s from IP: %s', $method, $path, $clientIp) + ); + } + $token = $request->getCookieParams()['auth_token'] ?? null; $session = null;