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;