Exemplo n.º 1
0
 public function validateCredentials(UserInterface $user, array $credentials)
 {
     if ($user->getUserName($credentials['username']) && $user->getPassword($credentials['password'])) {
         return true;
     }
     return false;
 }
Exemplo n.º 2
0
 /**
  * This is called when an authentication is successful.
  *
  * @param Request $request
  * @param UserInterface $user
  */
 public function set(Request $request, UserInterface $user)
 {
     $this->remove();
     if (!$this->isRememberMeRequested($request)) {
         return;
     }
     $expires = self::COOKIE_LIFETIME + time();
     $value = $this->generateCookieValue($user->getUsername(), $expires, $user->getPassword());
     $this->cookie->set($this->name, $value, $expires);
 }
Exemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function validateCredentials(UserInterface $user, array $credentials)
 {
     return $this->encoder->verify($user->getPassword(), $credentials['password']);
 }
Exemplo n.º 4
0
 /**
  * Sets the user to be used.
  *
  * @param  UserInterface $user
  * @param  bool          $remember
  */
 public function setUser(UserInterface $user, $remember = false)
 {
     $this->handler->write($user->getId(), $remember);
     $this->user = $user;
 }