slovocast/app/src/Routes.php

35 lines
825 B
PHP
Raw Normal View History

<?php
namespace Slovocast;
use Slim\App;
use Slovocast\Controller\HomePage;
use Slovocast\Controller\User\{
RegisterUserPage,
2024-06-17 00:44:12 +00:00
RegisterUserAction,
LoginUserPage
};
use Slovocast\Middleware\VerifyPasswordMiddleware;
class Routes
{
public static function init(App $app): void
{
$app->get('/', HomePage::class);
// User Routes
self::users($app);
}
protected static function users(App $app): void
{
2024-06-17 00:44:12 +00:00
$app->get('/users/register', RegisterUserPage::class)
->setName('user-register-page');
$app->post('/users/register', RegisterUserAction::class)
2024-06-17 00:44:12 +00:00
->add(VerifyPasswordMiddleware::class)
->setName('user-register-action');
$app->get('/login', LoginUserPage::class)
->setName('user-login-page');
}
}