Skip to content

Commit

Permalink
oof, fatality
Browse files Browse the repository at this point in the history
  • Loading branch information
1ma committed Jun 20, 2024
1 parent a4cf05c commit fe9e265
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/DI/Faucet.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ public function provide(Container $c): void
$app = AppFactory::create(container: $c);
$app->addErrorMiddleware($settings->debugMode, $settings->debugMode, $settings->debugMode);

$app->get('/', $c->get(Controller\LandingPage::class));
$formRoute = $app->post('/', $c->get(Controller\FormProcessing::class));
$app->get('/', Controller\LandingPage::class);
$formRoute = $app->post('/', Controller\FormProcessing::class);

// If captcha is enabled register captcha image generation route and
// activate captcha enforcing middleware on the form route
if ($settings->useCaptcha) {
$app->get('/captcha', $c->get(Controller\CaptchaImage::class));
$app->get('/captcha', Controller\CaptchaImage::class);
$formRoute->add(Middleware\CheckCaptcha::class);
}

Expand All @@ -164,8 +164,8 @@ public function provide(Container $c): void
// If user and global limits are both disabled there's no need to
// activate the Redis spinlock nor the limit enforcement middleware.
if (null !== $settings->userSessionMaxBtc || null !== $settings->globalSessionMaxBtc) {
$formRoute->add($c->get(Middleware\UsageLimits::class));
$formRoute->add($c->get(Middleware\RedisLock::class));
$formRoute->add(Middleware\UsageLimits::class);
$formRoute->add(Middleware\RedisLock::class);
}

return $app;
Expand Down

0 comments on commit fe9e265

Please sign in to comment.