Skip to content

Commit 6464e04

Browse files
Return 404 when group, role, or user not found
1 parent 1f2723e commit 6464e04

3 files changed

Lines changed: 3 additions & 9 deletions

File tree

app/sprinkles/admin/src/Controller/GroupController.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,7 @@ public function pageInfo(Request $request, Response $response, $args)
547547

548548
// If the group no longer exists, forward to main group listing page
549549
if (!$group) {
550-
$redirectPage = $this->ci->router->pathFor('uri_groups');
551-
552-
return $response->withRedirect($redirectPage);
550+
throw new NotFoundException();
553551
}
554552

555553
/** @var \UserFrosting\Sprinkle\Account\Authorize\AuthorizationManager $authorizer */

app/sprinkles/admin/src/Controller/RoleController.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -653,9 +653,7 @@ public function pageInfo(Request $request, Response $response, $args)
653653

654654
// If the role no longer exists, forward to main role listing page
655655
if (!$role) {
656-
$redirectPage = $this->ci->router->pathFor('uri_roles');
657-
658-
return $response->withRedirect($redirectPage);
656+
throw new NotFoundException();
659657
}
660658

661659
/** @var \UserFrosting\Sprinkle\Account\Authorize\AuthorizationManager $authorizer */

app/sprinkles/admin/src/Controller/UserController.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -909,9 +909,7 @@ public function pageInfo(Request $request, Response $response, $args)
909909

910910
// If the user no longer exists, forward to main user listing page
911911
if (!$user) {
912-
$usersPage = $this->ci->router->pathFor('uri_users');
913-
914-
return $response->withRedirect($usersPage);
912+
throw new NotFoundException();
915913
}
916914

917915
/** @var \UserFrosting\Sprinkle\Account\Authorize\AuthorizationManager $authorizer */

0 commit comments

Comments
 (0)