Beispiel #1
0
 public function actionPasswordReset($token)
 {
     try {
         $model = new PasswordResetForm($token, $this->module->passwordResetTokenExpire);
     } catch (InvalidParamException $e) {
         throw new BadRequestHttpException($e->getMessage());
     }
     if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->resetPassword()) {
         Yii::$app->getSession()->setFlash('success', Module::t('module', 'FLASH_PASSWORD_RESET_SUCCESS'));
         return $this->goHome();
     }
     return $this->render('passwordReset', ['model' => $model]);
 }
 public function testResetCorrectToken()
 {
     $form = new PasswordResetForm($this->users[0]['password_reset_token'], 3600);
     expect('password should be resetted', $form->resetPassword())->true();
 }