From 4c401cd807739cb6115c0c31e4d052774db3cdc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Tue, 18 Apr 2023 23:21:53 +0200 Subject: [PATCH] remove unnecessary startTransaction and commit calls --- src/Controller/LoginController.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/Controller/LoginController.php b/src/Controller/LoginController.php index a723817..94e7c82 100644 --- a/src/Controller/LoginController.php +++ b/src/Controller/LoginController.php @@ -226,16 +226,12 @@ class LoginController $passwordResetter->setToken($token); $passwordResetter->setExpiresDate($expires); - \Container::$dbConnection->startTransaction(); - if ($existingResetter !== null) { $this->pdm->deleteFromDb($existingResetter); } $this->pdm->saveToDb($passwordResetter); - \Container::$dbConnection->commit(); - $this->sendPasswordResetEmail($user->getEmail(), $token, $expires); return new JsonContent(['success' => true]); @@ -275,8 +271,6 @@ class LoginController return new JsonContent(['error' => ['errorText' => 'The given passwords do not match.']]); } - \Container::$dbConnection->startTransaction(); - $this->pdm->deleteFromDb($resetter); $user = $this->userRepository->getById($resetter->getUserId()); @@ -284,8 +278,6 @@ class LoginController $this->pdm->saveToDb($user); - \Container::$dbConnection->commit(); - $this->request->setUser($user); $this->deleteRedirectUrl();