remove unnecessary startTransaction and commit calls
All checks were successful
rvr-nextgen/pipeline/pr-master This commit looks good
All checks were successful
rvr-nextgen/pipeline/pr-master This commit looks good
This commit is contained in:
parent
617ae903ae
commit
b4cfa7aab2
@ -226,16 +226,12 @@ class LoginController
|
|||||||
$passwordResetter->setToken($token);
|
$passwordResetter->setToken($token);
|
||||||
$passwordResetter->setExpiresDate($expires);
|
$passwordResetter->setExpiresDate($expires);
|
||||||
|
|
||||||
\Container::$dbConnection->startTransaction();
|
|
||||||
|
|
||||||
if ($existingResetter !== null) {
|
if ($existingResetter !== null) {
|
||||||
$this->pdm->deleteFromDb($existingResetter);
|
$this->pdm->deleteFromDb($existingResetter);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->pdm->saveToDb($passwordResetter);
|
$this->pdm->saveToDb($passwordResetter);
|
||||||
|
|
||||||
\Container::$dbConnection->commit();
|
|
||||||
|
|
||||||
$this->sendPasswordResetEmail($user->getEmail(), $token, $expires);
|
$this->sendPasswordResetEmail($user->getEmail(), $token, $expires);
|
||||||
|
|
||||||
return new JsonContent(['success' => true]);
|
return new JsonContent(['success' => true]);
|
||||||
@ -275,8 +271,6 @@ class LoginController
|
|||||||
return new JsonContent(['error' => ['errorText' => 'The given passwords do not match.']]);
|
return new JsonContent(['error' => ['errorText' => 'The given passwords do not match.']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
\Container::$dbConnection->startTransaction();
|
|
||||||
|
|
||||||
$this->pdm->deleteFromDb($resetter);
|
$this->pdm->deleteFromDb($resetter);
|
||||||
|
|
||||||
$user = $this->userRepository->getById($resetter->getUserId());
|
$user = $this->userRepository->getById($resetter->getUserId());
|
||||||
@ -284,8 +278,6 @@ class LoginController
|
|||||||
|
|
||||||
$this->pdm->saveToDb($user);
|
$this->pdm->saveToDb($user);
|
||||||
|
|
||||||
\Container::$dbConnection->commit();
|
|
||||||
|
|
||||||
$this->request->setUser($user);
|
$this->request->setUser($user);
|
||||||
|
|
||||||
$this->deleteRedirectUrl();
|
$this->deleteRedirectUrl();
|
||||||
|
Loading…
Reference in New Issue
Block a user