Compare commits
4 Commits
e9aff1da32
...
4c401cd807
Author | SHA1 | Date | |
---|---|---|---|
4c401cd807 | |||
fefc18b892 | |||
a7997429b7 | |||
4d5e982370 |
@ -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();
|
||||||
|
11
views/error/500.php
Normal file
11
views/error/500.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
@extends(templates/layout_normal)
|
||||||
|
|
||||||
|
@section(main)
|
||||||
|
<h2>500 | Internal server error</h2>
|
||||||
|
<p>An error occured during processing your request. <a href="<?= Container::$routeCollection->getRoute('home')->generateLink() ?>" title="<?= $_ENV['APP_NAME'] ?>">Back to start.</a></p>
|
||||||
|
<?php if (isset($exceptionToPrint)): ?>
|
||||||
|
<pre class="marginTop">
|
||||||
|
<?= $exceptionToPrint ?>
|
||||||
|
</pre>
|
||||||
|
<?php endif; ?>
|
||||||
|
@endsection
|
3
web.php
3
web.php
@ -108,7 +108,8 @@ $appConfig = [
|
|||||||
'antiCsrfTokenErrorResponse' => ['error' => 'no_valid_anti_csrf_token'],
|
'antiCsrfTokenErrorResponse' => ['error' => 'no_valid_anti_csrf_token'],
|
||||||
'antiCsrfTokenExceptions' => ['/oauth/token'],
|
'antiCsrfTokenExceptions' => ['/oauth/token'],
|
||||||
'loginRouteId' => 'login',
|
'loginRouteId' => 'login',
|
||||||
'error404View' => 'error/404'
|
'error404View' => 'error/404',
|
||||||
|
'error500View' => 'error/500'
|
||||||
];
|
];
|
||||||
|
|
||||||
$httpReponse = new HttpResponse(
|
$httpReponse = new HttpResponse(
|
||||||
|
Loading…
Reference in New Issue
Block a user