1000 search results

87 lines | src/Security/ApiTokenAuthenticator.php
// ... lines 1 - 14
class ApiTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 17 - 71
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
{
// allow the authentication to continue
}
// ... lines 76 - 85
}
See Code Block in Script
87 lines | src/Security/ApiTokenAuthenticator.php
// ... lines 1 - 14
class ApiTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 17 - 76
public function start(Request $request, AuthenticationException $authException = null)
{
throw new \Exception('Not used: entry_point from other authentication is used');
}
// ... lines 81 - 85
}
See Code Block in Script
87 lines | src/Security/ApiTokenAuthenticator.php
// ... lines 1 - 14
class ApiTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 17 - 81
public function supportsRememberMe()
{
return false;
}
}
See Code Block in Script
54 lines | src/Security/ApiTokenAuthenticator.php
// ... lines 1 - 2
namespace App\Security;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Guard\AbstractGuardAuthenticator;
class ApiTokenAuthenticator extends AbstractGuardAuthenticator
{
public function supports(Request $request)
{
// todo
}
public function getCredentials(Request $request)
{
// todo
}
public function getUser($credentials, UserProviderInterface $userProvider)
{
// todo
}
public function checkCredentials($credentials, UserInterface $user)
{
// todo
}
public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
{
// todo
}
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
{
// todo
}
public function start(Request $request, AuthenticationException $authException = null)
{
// todo
}
public function supportsRememberMe()
{
// todo
}
}
See Code Block in Script
82 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 18
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 21 - 71
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
{
return new RedirectResponse($this->router->generate('app_homepage'));
}
// ... lines 76 - 80
}
See Code Block in Script
89 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 17
use Symfony\Component\Security\Http\Util\TargetPathTrait;
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
use TargetPathTrait;
// ... lines 23 - 87
}
See Code Block in Script
89 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 19
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 22 - 74
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
{
if ($targetPath = $this->getTargetPath($request->getSession(), $providerKey)) {
// ... line 78
}
// ... lines 80 - 81
}
// ... lines 83 - 87
}
See Code Block in Script
89 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 19
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 22 - 74
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
{
if ($targetPath = $this->getTargetPath($request->getSession(), $providerKey)) {
return new RedirectResponse($targetPath);
}
// ... lines 80 - 81
}
// ... lines 83 - 87
}
See Code Block in Script
89 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 19
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 22 - 74
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
{
if ($targetPath = $this->getTargetPath($request->getSession(), $providerKey)) {
return new RedirectResponse($targetPath);
}
return new RedirectResponse($this->router->generate('app_homepage'));
}
// ... lines 83 - 87
}
See Code Block in Script
80 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 17
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 20 - 63
public function checkCredentials($credentials, UserInterface $user)
{
// only needed if we need to check a password - we'll do that later!
return true;
}
// ... lines 69 - 78
}
See Code Block in Script
82 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 9
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
// ... lines 11 - 18
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 21 - 23
private $passwordEncoder;
public function __construct(UserRepository $userRepository, RouterInterface $router, CsrfTokenManagerInterface $csrfTokenManager, UserPasswordEncoderInterface $passwordEncoder)
{
// ... lines 28 - 30
$this->passwordEncoder = $passwordEncoder;
}
// ... lines 33 - 80
}
See Code Block in Script
82 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 18
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 21 - 66
public function checkCredentials($credentials, UserInterface $user)
{
return $this->passwordEncoder->isPasswordValid($user, $credentials['password']);
}
// ... lines 71 - 80
}
See Code Block in Script
37 lines | templates/security/login.html.twig
// ... lines 1 - 10
{% block body %}
<form class="form-signin" method="post">
// ... lines 13 - 26
<div class="checkbox mb-3">
<label>
<input type="checkbox" value="remember-me"> Remember me
</label>
</div>
// ... lines 32 - 34
</form>
{% endblock %}
See Code Block in Script
37 lines | templates/security/login.html.twig
// ... lines 1 - 10
{% block body %}
<form class="form-signin" method="post">
// ... lines 13 - 26
<div class="checkbox mb-3">
<label>
<input type="checkbox" name="_remember_me"> Remember me
</label>
</div>
// ... lines 32 - 34
</form>
{% endblock %}
See Code Block in Script
57 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 11
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 14 - 35
public function getUser($credentials, UserProviderInterface $userProvider)
{
return $this->userRepository->findOneBy(['email' => $credentials['email']]);
}
public function checkCredentials($credentials, UserInterface $user)
{
// only needed if we need to check a password - we'll do that later!
return true;
}
// ... lines 46 - 55
}
See Code Block in Script
57 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 11
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 14 - 46
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
{
dd('success!');
}
// ... lines 51 - 55
}
See Code Block in Script
61 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 7
use Symfony\Component\Routing\RouterInterface;
// ... lines 9 - 13
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 16 - 18
public function __construct(UserRepository $userRepository, RouterInterface $router)
{
// ... lines 21 - 22
}
// ... lines 24 - 59
}
See Code Block in Script
61 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 7
use Symfony\Component\Routing\RouterInterface;
// ... lines 9 - 13
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... line 16
private $router;
public function __construct(UserRepository $userRepository, RouterInterface $router)
{
// ... line 21
$this->router = $router;
}
// ... lines 24 - 59
}
See Code Block in Script
61 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 13
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 16 - 50
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
{
return new RedirectResponse($this->router->generate('app_homepage'));
}
// ... lines 55 - 59
}
See Code Block in Script
61 lines | src/Security/LoginFormAuthenticator.php
// ... lines 1 - 13
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 16 - 55
protected function getLoginUrl()
{
// TODO: Implement getLoginUrl() method.
}
}
See Code Block in Script