|
7 | 7 | use Dystore\Api\Domain\Carts\Actions\CreateUserFromCart; |
8 | 8 | use Dystore\Api\Domain\Payments\Contracts\PaymentIntent as PaymentIntentContract; |
9 | 9 | use Dystore\Api\Domain\Payments\Data\PaymentIntent; |
10 | | -use Dystore\Api\Domain\Prices\Http\Middleware\SetApiPricing; |
11 | 10 | use Dystore\Api\Domain\Users\Actions\CreateUser; |
12 | 11 | use Dystore\Api\Domain\Users\Actions\RegisterUser; |
13 | 12 | use Dystore\Api\Facades\Api; |
14 | | -use Dystore\Api\Routing\Middleware\SetApiHeaders; |
15 | 13 | use Dystore\Api\Support\Config\Collections\DomainConfigCollection; |
16 | 14 | use Illuminate\Foundation\Application; |
17 | 15 | use Illuminate\Routing\Router; |
@@ -392,8 +390,16 @@ protected function registerMiddleware(): void |
392 | 390 | /** @var Router $router */ |
393 | 391 | $router = $this->app['router']; |
394 | 392 |
|
395 | | - $router->aliasMiddleware('api-pricing', SetApiPricing::class); |
396 | | - $router->aliasMiddleware('api-headers', SetApiHeaders::class); |
| 393 | + $router->aliasMiddleware('api-pricing', \Dystore\Api\Domain\Prices\Http\Middleware\SetApiPricing::class); |
| 394 | + $router->aliasMiddleware('api-headers', \Dystore\Api\Routing\Middleware\SetApiHeaders::class); |
| 395 | + |
| 396 | + /** @var \Illuminate\Foundation\Http\Kernel $kernel */ |
| 397 | + $kernel = $this->app->make(\Illuminate\Contracts\Http\Kernel::class); |
| 398 | + |
| 399 | + $kernel->addToMiddlewarePriorityBefore( |
| 400 | + before: \Dystore\Api\Routing\Middleware\SetApiHeaders::class, |
| 401 | + middleware: \Illuminate\Auth\Middleware\Authenticate::class |
| 402 | + ); |
397 | 403 | } |
398 | 404 |
|
399 | 405 | /** |
|
0 commit comments