Compare commits

...

2 Commits

Author SHA1 Message Date
4c401cd807
remove unnecessary startTransaction and commit calls
Some checks failed
rvr-nextgen/pipeline/pr-master There was a failure building this commit
2023-04-18 23:26:42 +02:00
fefc18b892
add error view 500 to app config 2023-04-18 23:26:42 +02:00
2 changed files with 2 additions and 10 deletions

View File

@ -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();

View File

@ -108,12 +108,12 @@ $appConfig = [
'antiCsrfTokenErrorResponse' => ['error' => 'no_valid_anti_csrf_token'],
'antiCsrfTokenExceptions' => ['/oauth/token'],
'loginRouteId' => 'login',
'error404View' => 'error/404'
'error404View' => 'error/404',
'error500View' => 'error/500'
];
$httpReponse = new HttpResponse(
Container::$request,
Container::$dbConnection,
Container::$routeCollection,
$appConfig,
$_SERVER['REQUEST_METHOD'],