Commit 39cc5abb authored by Moreau Elise's avatar Moreau Elise
Browse files

add middleware in routes file

parent f6fc22f5
......@@ -39,6 +39,7 @@ use Slim\Interfaces\RouteCollectorProxyInterface as Group;
use Slim\Views\Twig;
use Slim\Flash\Messages;
use App\Application\Middleware\AuthMiddleware;
return function (App $app) {
$app->options(
......@@ -100,15 +101,15 @@ return function (App $app) {
$group->post('', CreateUserAction::class);
}
);
$app->group(
'/account', function (Group $group) {
$group->get('', AccountAction::class);
$group->post('/delete', DeleteUserAction::class);
$group->get('/modify', ViewModifyForm::class);
$group->post('/modify', ModifyUserAction::class);
$group->get('/modify', ViewModifyForm::class);
$group->post('/modify', ModifyUserAction::class);
}
);
)->add(AuthMiddleware::class);
$app->group(
'/groups', function (Group $group) {
......@@ -130,12 +131,11 @@ return function (App $app) {
}
);
$app->group(
'/api', function (Group $group) {
$group->get('/users', ListUsersJson::class);
$group->get('/{id}/userscontaminated', ContaminatedUsersInGroup::class);
$group->get('/nearuserscontaminated', NearContaminatedUsers::class);
$group->get('/nearcontaminatedusers', NearContaminatedUsers::class);
}
);
)->add(AuthMiddleware::class);
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment