示例#1
0
 /**
  * Attempts to authenticate the given user
  * according to the passed credentials.
  *
  * @param array $credentials
  * @param bool  $remember
  *
  * @return \Cartalyst\Sentry\Users\UserInterface
  *
  * @throws \Cartalyst\Sentry\Throttling\UserBannedException
  * @throws \Cartalyst\Sentry\Throttling\UserSuspendedException
  * @throws \Cartalyst\Sentry\Users\LoginRequiredException
  * @throws \Cartalyst\Sentry\Users\PasswordRequiredException
  * @throws \Cartalyst\Sentry\Users\UserNotFoundException
  *
  * @api
  */
 public function authenticate(array $credentials, $remember = false)
 {
     User::setCallerForNext($this);
     $user = Sentry::authenticate($credentials, $remember);
     User::removeCaller();
     return $user;
 }