Skip to content

Commit

Permalink
Re-enable NoCache Middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Apr 18, 2023
1 parent 318262f commit 1d0e512
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 16 deletions.
5 changes: 3 additions & 2 deletions app/src/Routes/ActivitiesRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use UserFrosting\Routes\RouteDefinitionInterface;
use UserFrosting\Sprinkle\Account\Authenticate\AuthGuard;
use UserFrosting\Sprinkle\Admin\Controller\Activity\ActivitiesPageAction;
use UserFrosting\Sprinkle\Core\Middlewares\NoCache;

/*
* Routes for administrative activity monitoring.
Expand All @@ -28,10 +29,10 @@ public function register(App $app): void
$app->group('/activities', function (RouteCollectorProxy $group) {
$group->get('', ActivitiesPageAction::class)
->setName('uri_activities');
})->add(AuthGuard::class); //->add(new NoCache());
})->add(AuthGuard::class)->add(NoCache::class);

$app->group('/api/activities', function (RouteCollectorProxy $group) {
$group->get('', [ActivitiesPageAction::class, 'sprunje']);
})->add(AuthGuard::class); //->add(new NoCache());
})->add(AuthGuard::class)->add(NoCache::class);
}
}
7 changes: 4 additions & 3 deletions app/src/Routes/DashboardRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use UserFrosting\Sprinkle\Admin\Controller\Dashboard\CacheApiAction;
use UserFrosting\Sprinkle\Admin\Controller\Dashboard\CacheModalAction;
use UserFrosting\Sprinkle\Admin\Controller\Dashboard\DashboardAction;
use UserFrosting\Sprinkle\Core\Middlewares\NoCache;

/*
* Routes for dashboard page.
Expand All @@ -28,12 +29,12 @@ public function register(App $app): void
{
$app->get('/dashboard', DashboardAction::class)
->setName('dashboard')
->add(AuthGuard::class); // ->add(new NoCache());
->add(AuthGuard::class)->add(NoCache::class);

$app->post('/api/dashboard/clear-cache', CacheApiAction::class)
->add(AuthGuard::class); // ->add(new NoCache());
->add(AuthGuard::class)->add(NoCache::class);

$app->get('/modals/dashboard/clear-cache', CacheModalAction::class)
->add(AuthGuard::class); // ->add(new NoCache());
->add(AuthGuard::class)->add(NoCache::class);
}
}
7 changes: 4 additions & 3 deletions app/src/Routes/GroupsRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use UserFrosting\Sprinkle\Admin\Controller\Group\GroupsPageAction;
use UserFrosting\Sprinkle\Admin\Controller\Group\GroupUsersSprunje;
use UserFrosting\Sprinkle\Admin\Middlewares\GroupInjector;
use UserFrosting\Sprinkle\Core\Middlewares\NoCache;

/*
* Routes for administrative group management.
Expand All @@ -40,7 +41,7 @@ public function register(App $app): void
$group->get('/g/{slug}', GroupPageAction::class)
->add(GroupInjector::class)
->setName('page.group');
})->add(AuthGuard::class); //->add(new NoCache());
})->add(AuthGuard::class)->add(NoCache::class);

$app->group('/api/groups', function (RouteCollectorProxy $group) {
$group->delete('/g/{slug}', GroupDeleteAction::class)
Expand All @@ -51,7 +52,7 @@ public function register(App $app): void
$group->post('', GroupCreateAction::class);
$group->put('/g/{slug}', GroupEditAction::class)
->add(GroupInjector::class);
})->add(AuthGuard::class); //->add(new NoCache());
})->add(AuthGuard::class)->add(NoCache::class);

$app->group('/modals/groups', function (RouteCollectorProxy $group) {
$group->get('/confirm-delete', GroupDeleteModal::class)
Expand All @@ -62,6 +63,6 @@ public function register(App $app): void
$group->get('/edit', GroupEditModal::class)
->add(GroupInjector::class)
->setName('modal.groups.edit');
})->add(AuthGuard::class); //->add(new NoCache());
})->add(AuthGuard::class)->add(NoCache::class);
}
}
5 changes: 3 additions & 2 deletions app/src/Routes/PermissionsRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use UserFrosting\Sprinkle\Admin\Controller\Permission\PermissionsPageAction;
use UserFrosting\Sprinkle\Admin\Controller\Permission\PermissionUserSprunje;
use UserFrosting\Sprinkle\Admin\Middlewares\PermissionInjector;
use UserFrosting\Sprinkle\Core\Middlewares\NoCache;

/*
* Routes for administrative permission management.
Expand All @@ -33,12 +34,12 @@ public function register(App $app): void
->setName('uri_permissions');
$group->get('/p/{id}', PermissionPageAction::class)
->add(PermissionInjector::class);
})->add(AuthGuard::class); //->add(new NoCache());
})->add(AuthGuard::class)->add(NoCache::class);

$app->group('/api/permissions', function (RouteCollectorProxy $group) {
$group->get('', [PermissionsPageAction::class, 'sprunje']);
$group->get('/p/{id}/users', PermissionUserSprunje::class)
->add(PermissionInjector::class);
})->add(AuthGuard::class); //->add(new NoCache());
})->add(AuthGuard::class)->add(NoCache::class);
}
}
7 changes: 4 additions & 3 deletions app/src/Routes/RolesRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use UserFrosting\Sprinkle\Admin\Controller\Role\RoleUpdateFieldAction;
use UserFrosting\Sprinkle\Admin\Controller\Role\RoleUsersSprunje;
use UserFrosting\Sprinkle\Admin\Middlewares\RoleInjector;
use UserFrosting\Sprinkle\Core\Middlewares\NoCache;

/*
* Routes for administrative role management.
Expand All @@ -42,7 +43,7 @@ public function register(App $app): void
->setName('uri_roles');
$group->get('/r/{slug}', RolePageAction::class)
->add(RoleInjector::class);
})->add(AuthGuard::class); //->add(new NoCache());
})->add(AuthGuard::class)->add(NoCache::class);

$app->group('/api/roles', function (RouteCollectorProxy $group) {
$group->delete('/r/{slug}', RoleDeleteAction::class)
Expand All @@ -57,7 +58,7 @@ public function register(App $app): void
->add(RoleInjector::class);
$group->put('/r/{slug}/{field}', RoleUpdateFieldAction::class)
->add(RoleInjector::class);
})->add(AuthGuard::class); //->add(new NoCache());
})->add(AuthGuard::class)->add(NoCache::class);

$app->group('/modals/roles', function (RouteCollectorProxy $group) {
$group->get('/confirm-delete', RoleDeleteModal::class)
Expand All @@ -71,6 +72,6 @@ public function register(App $app): void
$group->get('/permissions', RoleEditPermissionsModal::class)
->add(RoleInjector::class)
->setName('modal.roles.permissions');
})->add(AuthGuard::class); //->add(new NoCache());
})->add(AuthGuard::class)->add(NoCache::class);
}
}
7 changes: 4 additions & 3 deletions app/src/Routes/UsersRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
use UserFrosting\Sprinkle\Admin\Controller\User\UsersPageAction;
use UserFrosting\Sprinkle\Admin\Controller\User\UserUpdateFieldAction;
use UserFrosting\Sprinkle\Admin\Middlewares\UserInjector;
use UserFrosting\Sprinkle\Core\Middlewares\NoCache;

/*
* Routes for administrative user management.
Expand All @@ -46,7 +47,7 @@ public function register(App $app): void
$group->get('/u/{user_name}', UserPageAction::class)
->add(UserInjector::class)
->setName('page.user');
})->add(AuthGuard::class); //->add(new NoCache());
})->add(AuthGuard::class)->add(NoCache::class);

$app->group('/api/users', function (RouteCollectorProxy $group) {
$group->get('', [UsersPageAction::class, 'sprunje'])
Expand All @@ -71,7 +72,7 @@ public function register(App $app): void
$group->put('/u/{user_name}/{field}', UserUpdateFieldAction::class)
->add(UserInjector::class)
->setName('api.users.update-field');
})->add(AuthGuard::class); //->add(new NoCache());
})->add(AuthGuard::class)->add(NoCache::class);

$app->group('/modals/users', function (RouteCollectorProxy $group) {
$group->get('/confirm-delete', UserDeleteModal::class)
Expand All @@ -88,6 +89,6 @@ public function register(App $app): void
$group->get('/roles', UserEditRolesModal::class)
->add(UserInjector::class)
->setName('modal.users.roles');
})->add(AuthGuard::class); //->add(new NoCache());
})->add(AuthGuard::class)->add(NoCache::class);
}
}

0 comments on commit 1d0e512

Please sign in to comment.