Browse Source

[Connexion] Remember me

develop
Guillaume 2 years ago
parent
commit
e498aaf662
2 changed files with 6 additions and 1 deletions
  1. +5
    -1
      Authenticator/LoginFormAuthenticator.php
  2. +1
    -0
      Controller/ControllerTrait.php

+ 5
- 1
Authenticator/LoginFormAuthenticator.php View File

use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\Security;
use Symfony\Component\Security\Http\Authenticator\AbstractLoginFormAuthenticator; use Symfony\Component\Security\Http\Authenticator\AbstractLoginFormAuthenticator;
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\CsrfTokenBadge; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\CsrfTokenBadge;
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\RememberMeBadge;
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\PasswordCredentials; use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\PasswordCredentials;
use Symfony\Component\Security\Http\Authenticator\Passport\Passport; use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
return $this->userStore->getOneByEmail($userIdentifier); return $this->userStore->getOneByEmail($userIdentifier);
}), }),
new PasswordCredentials($password), new PasswordCredentials($password),
[new CsrfTokenBadge('authenticate', $csrfToken)]
[
new CsrfTokenBadge('authenticate', $csrfToken),
new RememberMeBadge()
]
); );
} }



+ 1
- 0
Controller/ControllerTrait.php View File

use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\Security;
use Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use Twig\Environment; use Twig\Environment;



Loading…
Cancel
Save