controllers/RecoveryController.php
public function actionReset($id, $code)
	{
		$model = User::findOne([
			'id'                   => $id,
			'password_reset_token' => $code,
			'status'               => User::STATUS_ACTIVE
		]);

		if ($model == NULL)
			throw new NotFoundHttpException;

		$model->scenario = 'reset';

		if (!empty($model)) {
			if ($model->load(Yii::$app->request->post())) {
				if ($model->validate()) {
					$model->password_reset_token = NULL;
					$model->save();

					Yii::$app->session->setFlash('success', Yii::t('user', 'Your password has successfully been changed. Now you can login with your new password.'));

					return $this->redirect(['//user/auth/login']);
				}
			}
		}

		return $this->render('reset', ['model' => $model]);
	}
public function actionReset($id, $code)
	{
		$model = User::findOne([
			'id'                   => $id,
			'password_reset_token' => $code,
			'status'               => User::STATUS_ACTIVE
		]);

		if ($model == NULL)
			throw new NotFoundHttpException;

		$model->scenario = 'reset';

		if (!empty($model)) {
			if ($model->load(Yii::$app->request->post())) {
				if ($model->validate()) {
					$model->password_reset_token = NULL;
					$model->save();

					Yii::$app->session->setFlash('success', Yii::t('user', 'Your password has successfully been changed. Now you can login with your new password.'));

					return $this->redirect(['//user/auth/login']);
				}
			}
		}

		return $this->render('reset', ['model' => $model]);
	}
@param integer $id   User Id
@param string  $code Password Reset Token

@return string
@throws \yii\web\NotFoundHttpException