mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Fix CSRF on user deletion
This commit is contained in:
parent
784bc1393c
commit
f1b3d5cdd7
3 changed files with 14 additions and 8 deletions
|
@ -586,7 +586,7 @@ class ConfigController extends Controller
|
|||
/**
|
||||
* Delete account for current user.
|
||||
*
|
||||
* @Route("/account/delete", name="delete_account")
|
||||
* @Route("/account/delete", name="delete_account", methods={"POST"})
|
||||
*
|
||||
* @throws AccessDeniedHttpException
|
||||
*
|
||||
|
@ -594,6 +594,10 @@ class ConfigController extends Controller
|
|||
*/
|
||||
public function deleteAccountAction(Request $request)
|
||||
{
|
||||
if (!$this->isCsrfTokenValid('delete-account', $request->request->get('token'))) {
|
||||
throw $this->createAccessDeniedException('Bad CSRF token.');
|
||||
}
|
||||
|
||||
$enabledUsers = $this->get('wallabag_user.user_repository')
|
||||
->getSumEnabledUsers();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue