Always show a feedback when recovering password (#249)
Even if email doesn't exist
This commit is contained in:
committed by
Lorenzo Milesi
parent
eaa6bf967f
commit
adf9321db8
@ -41,6 +41,13 @@ class PasswordRecoveryService implements ServiceInterface
|
||||
public function run()
|
||||
{
|
||||
try {
|
||||
if ($this->getModule()->enableFlashMessages == true) {
|
||||
Yii::$app->session->setFlash(
|
||||
'info',
|
||||
Yii::t('usuario', 'An email with instructions to create a new password has been sent to {email} if it is associated with an {appName} account. Your existing password has not been changed.', ['email' => $this->email, 'appName' => Yii::$app->name])
|
||||
);
|
||||
}
|
||||
|
||||
/** @var User $user */
|
||||
$user = $this->query->whereEmail($this->email)->one();
|
||||
|
||||
@ -60,13 +67,6 @@ class PasswordRecoveryService implements ServiceInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->getModule()->enableFlashMessages == true) {
|
||||
Yii::$app->session->setFlash(
|
||||
'info',
|
||||
Yii::t('usuario', 'An email has been sent with instructions for resetting your password')
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (Exception $e) {
|
||||
Yii::error($e->getMessage(), 'usuario');
|
||||
|
||||
Reference in New Issue
Block a user