コード例 #1
0
ファイル: PasswordBroker.php プロジェクト: yashb/generator
 /**
  * Validate a password reset for the given credentials.
  *
  * @param  array  $credentials
  * @return \Illuminate\Auth\RemindableInterface
  */
 protected function validateReset(array $credentials)
 {
     if (is_null($user = $this->getUser($credentials))) {
         return self::INVALID_USER;
     }
     if (!$this->validNewPasswords($credentials)) {
         return self::INVALID_PASSWORD;
     }
     if (!$this->reminders->exists($user, $credentials['token'])) {
         return self::INVALID_TOKEN;
     }
     return $user;
 }
コード例 #2
0
 /**
  * Validate a password reset for the given credentials.
  *
  * @param  array  $credenitals
  * @return \Illuminate\Auth\RemindableInterface
  */
 protected function validateReset(array $credentials)
 {
     if (is_null($user = $this->getUser($credentials))) {
         return $this->makeErrorRedirect('user');
     }
     if (!$this->validNewPasswords()) {
         return $this->makeErrorRedirect('password');
     }
     if (!$this->reminders->exists($user, $this->getToken())) {
         return $this->makeErrorRedirect('token');
     }
     return $user;
 }