Ejemplo n.º 1
0
 public function validateCredentials(UserInterface $user, array $credentials)
 {
     if ($user->getUserName($credentials['username']) && $user->getPassword($credentials['password'])) {
         return true;
     }
     return false;
 }
Ejemplo 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);
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function validateCredentials(UserInterface $user, array $credentials)
 {
     return $this->encoder->verify($user->getPassword(), $credentials['password']);
 }