Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MOREAU Elise
project-covid
Commits
39cc5abb
Commit
39cc5abb
authored
Oct 31, 2020
by
Moreau Elise
Browse files
add middleware in routes file
parent
f6fc22f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/routes.php
View file @
39cc5abb
...
...
@@ -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
(
'/near
users
contaminated'
,
NearContaminatedUsers
::
class
);
$group
->
get
(
'/nearcontaminated
users
'
,
NearContaminatedUsers
::
class
);
}
);
)
->
add
(
AuthMiddleware
::
class
);
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment