Skip to content

Commit

Permalink
Call AFTER_CONFIRMATION event only if confirmation actually happens
Browse files Browse the repository at this point in the history
  • Loading branch information
TonisOrmisson committed Nov 20, 2017
1 parent 4978d33 commit bf3b170
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions controllers/RegistrationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,10 @@ public function actionConfirm($id, $code)

$this->trigger(self::EVENT_BEFORE_CONFIRM, $event);

$user->attemptConfirmation($code);
if($user->attemptConfirmation($code)){
$this->trigger(self::EVENT_AFTER_CONFIRM, $event);
}

$this->trigger(self::EVENT_AFTER_CONFIRM, $event);

return $this->render('/message', [
'title' => \Yii::t('user', 'Account confirmation'),
Expand Down

0 comments on commit bf3b170

Please sign in to comment.