mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-30 19:36:02 -05:00
Return correct error message when deleting self, add test coverage (#5456)
This commit is contained in:
@@ -89,8 +89,8 @@ class UserController extends Controller
|
||||
*/
|
||||
public function delete(Request $request, User $user): RedirectResponse
|
||||
{
|
||||
if ($request->user()->id === $user->id) {
|
||||
throw new DisplayException($this->translator->get('admin/user.exceptions.user_has_servers'));
|
||||
if ($request->user()->is($user)) {
|
||||
throw new DisplayException(__('admin/user.exceptions.delete_self'));
|
||||
}
|
||||
|
||||
$this->deletionService->handle($user);
|
||||
|
||||
Reference in New Issue
Block a user