Add error output of password recovery form to log

This commit is contained in:
Visman 2021-02-09 14:45:15 +07:00
parent 796a2a4db1
commit 5277ec00f0

View file

@ -229,12 +229,14 @@ class Auth extends Page
$isValid = $v->validation($_POST, true);
$context = [
'user' => $this->user->fLog(), // ???? Guest only?
'errors' => $v->getErrors(true),
'form' => $v->getData(false, ['token']),
'headers' => true,
];
if ($isValid) {
$tmpUser = $this->c->users->create();
$isSent = false;
$v = $this->c->Validator->reset()
->addRules([
@ -272,8 +274,6 @@ class Auth extends Page
->setTpl('passphrase_reset.tpl', $tplData)
->send();
} catch (MailException $e) {
$isSent = false;
$this->c->Log->error('Passphrase reset: email form, MailException', [
'exception' => $e,
'headers' => false,
@ -288,7 +288,11 @@ class Auth extends Page
$this->c->Log->info('Passphrase reset: email form, ok', $context);
}
} else {
}
if (! $isSent) {
$context['errors'] = $v->getErrors(true);
$this->c->Log->warning('Passphrase reset: email form, fail', $context);
}