diff --git a/CHANGELOG.md b/CHANGELOG.md index efd711b..5925824 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Enh #143: Introduced "conflict" configuration in composer.json (maxxer) - Enh #145: Allowed the `+` sign in username (maxxer) - Bug #9: Documentation about migration from Dektrium tools (maxxer) +- Bug #110: Honor `enableFlashMessages` in `PasswordRecoveryService` (maxxer) ## 1.1.1 - November 27, 2017 - Bug #115: Convert client_id to string because pgsql fail with type convertion (Dezinger) diff --git a/src/User/Service/PasswordRecoveryService.php b/src/User/Service/PasswordRecoveryService.php index 5f319b0..032257e 100644 --- a/src/User/Service/PasswordRecoveryService.php +++ b/src/User/Service/PasswordRecoveryService.php @@ -16,12 +16,14 @@ use Da\User\Factory\TokenFactory; use Da\User\Model\User; use Da\User\Query\UserQuery; use Da\User\Traits\MailAwareTrait; +use Da\User\Traits\ModuleAwareTrait; use Exception; use Yii; class PasswordRecoveryService implements ServiceInterface { use MailAwareTrait; + use ModuleAwareTrait; protected $query; @@ -58,10 +60,12 @@ class PasswordRecoveryService implements ServiceInterface return false; } - Yii::$app->session->setFlash( - 'info', - Yii::t('usuario', 'An email has been sent with instructions for resetting your password') - ); + 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) {