chore: .gitea folder and RoutingMiddleware.php

This commit is contained in:
2025-07-17 19:13:47 +02:00
parent a9e70b3817
commit cec1b42da3
2 changed files with 277 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Framework\Http\Middlewares;
use App\Framework\Auth\Auth;
use App\Framework\Config\TypedConfiguration;
use App\Framework\Http\HttpMiddleware;
use App\Framework\Http\MiddlewareContext;
use App\Framework\Http\MiddlewarePriority;
@@ -25,6 +26,7 @@ final readonly class RoutingMiddleware implements HttpMiddleware
public function __construct(
private HttpRouter $router,
private RouteDispatcher $dispatcher,
private TypedConfiguration $config,
) {}
/**
@@ -47,7 +49,7 @@ final readonly class RoutingMiddleware implements HttpMiddleware
throw new RouteNotFound($routeContext->path);
}
if (in_array(Auth::class, $routeContext->match->route->attributes)) {
if (!$this->config->app->debug && in_array(Auth::class, $routeContext->match->route->attributes)) {
#debug($request->server->getClientIp());
$wireguardIp = '172.20.0.1';