示例#1
0
 /**
  * Get the user for the given credentials.
  *
  * @param  array  $credentials
  * @return \Nova\Auth\Reminders\RemindableInterface
  *
  * @throws \UnexpectedValueException
  */
 public function getUser(array $credentials)
 {
     $credentials = array_except($credentials, array('token'));
     $user = $this->users->retrieveByCredentials($credentials);
     if ($user && !$user instanceof RemindableInterface) {
         throw new \UnexpectedValueException("User must implement Remindable interface.");
     }
     return $user;
 }
示例#2
0
 /**
  * Refresh the remember token for the user.
  *
  * @param  \Auth\UserInterface  $user
  * @return void
  */
 protected function refreshRememberToken(UserInterface $user)
 {
     $user->setRememberToken($token = str_random(60));
     $this->provider->updateRememberToken($user, $token);
 }