Skip to content

Commit

Permalink
Fix #607
Browse files Browse the repository at this point in the history
  • Loading branch information
dmeroff committed Mar 25, 2016
1 parent 51a4696 commit 942fe6a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions models/RecoveryForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,18 @@ public function sendRecoveryMessage()
'user_id' => $this->user->id,
'type' => Token::TYPE_RECOVERY,
]);
$token->save(false);
$this->mailer->sendRecoveryMessage($this->user, $token);
Yii::$app->session->setFlash('info', Yii::t('user', 'An email has been sent with instructions for resetting your password'));

if (!$token->save(false)) {
return false;
}

if (!$this->mailer->sendRecoveryMessage($this->user, $token)) {
return false;
}

Yii::$app->session->setFlash('info',
Yii::t('user', 'An email has been sent with instructions for resetting your password')
);

return true;
}
Expand Down

0 comments on commit 942fe6a

Please sign in to comment.