first commit
This commit is contained in:
33
src/Identity/UI/Http/AuthRoutes.php
Normal file
33
src/Identity/UI/Http/AuthRoutes.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Netig\Netslim\Identity\UI\Http;
|
||||
|
||||
use Netig\Netslim\Identity\UI\Http\Middleware\AuthMiddleware;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Slim\App;
|
||||
|
||||
/**
|
||||
* Enregistre les routes HTTP du sous-domaine authentification.
|
||||
*/
|
||||
final class AuthRoutes
|
||||
{
|
||||
/** @param App<ContainerInterface> $app */
|
||||
public static function register(App $app): void
|
||||
{
|
||||
$app->get('/auth/login', [AuthController::class, 'showLogin']);
|
||||
$app->post('/auth/login', [AuthController::class, 'login']);
|
||||
$app->post('/auth/logout', [AuthController::class, 'logout']);
|
||||
|
||||
$app->get('/password/forgot', [PasswordResetController::class, 'showForgot']);
|
||||
$app->post('/password/forgot', [PasswordResetController::class, 'forgot']);
|
||||
$app->get('/password/reset', [PasswordResetController::class, 'showReset']);
|
||||
$app->post('/password/reset', [PasswordResetController::class, 'reset']);
|
||||
|
||||
$app->group('/account', function ($group) {
|
||||
$group->get('/password', [AccountController::class, 'showChangePassword']);
|
||||
$group->post('/password', [AccountController::class, 'changePassword']);
|
||||
})->add(AuthMiddleware::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user