1000 search results

// ... lines 1 - 5
use Symfony\Component\Form\FormFactoryInterface;
// ... lines 7 - 11
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 14 - 15
public function __construct(FormFactoryInterface $formFactory)
{
// ... line 18
}
// ... lines 20 - 51
}
See Code Block in Script
// ... lines 1 - 11
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
private $formFactory;
public function __construct(FormFactoryInterface $formFactory)
{
$this->formFactory = $formFactory;
}
// ... lines 20 - 51
}
See Code Block in Script
// ... lines 1 - 4
use AppBundle\Form\LoginForm;
// ... lines 6 - 11
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 14 - 20
public function getCredentials(Request $request)
{
$isLoginSubmit = $request->getPathInfo() == '/login' && $request->isMethod('POST');
if (!$isLoginSubmit) {
// skip authentication
return;
}
$form = $this->formFactory->create(LoginForm::class);
// ... lines 30 - 34
}
// ... lines 36 - 51
}
See Code Block in Script
// ... lines 1 - 22
$isLoginSubmit = $request->getPathInfo() == '/login' && $request->isMethod('POST');
if (!$isLoginSubmit) {
// skip authentication
return;
}
$form = $this->formFactory->create(LoginForm::class);
$form->handleRequest($request);
// ... lines 31 - 53
See Code Block in Script
// ... lines 1 - 22
$isLoginSubmit = $request->getPathInfo() == '/login' && $request->isMethod('POST');
if (!$isLoginSubmit) {
// skip authentication
return;
}
$form = $this->formFactory->create(LoginForm::class);
$form->handleRequest($request);
$data = $form->getData();
return $data;
// ... lines 35 - 53
See Code Block in Script
// ... lines 1 - 8
use Symfony\Component\Routing\RouterInterface;
// ... lines 10 - 13
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 16 - 19
public function __construct(FormFactoryInterface $formFactory, EntityManager $em, RouterInterface $router)
{
// ... lines 22 - 24
}
// ... lines 26 - 70
}
See Code Block in Script
// ... lines 1 - 13
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 16 - 17
private $router;
public function __construct(FormFactoryInterface $formFactory, EntityManager $em, RouterInterface $router)
{
// ... lines 22 - 23
$this->router = $router;
}
// ... lines 26 - 70
}
See Code Block in Script
// ... lines 1 - 13
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 16 - 61
protected function getLoginUrl()
{
return $this->router->generate('security_login');
}
// ... lines 66 - 70
}
See Code Block in Script
// ... lines 1 - 13
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 16 - 66
protected function getDefaultSuccessRedirectUrl()
{
// ... line 69
}
}
See Code Block in Script
// ... lines 1 - 13
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 16 - 66
protected function getDefaultSuccessRedirectUrl()
{
return $this->router->generate('homepage');
}
}
See Code Block in Script
// ... lines 1 - 9
use Symfony\Component\Security\Core\Security;
// ... lines 11 - 14
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 17 - 27
public function getCredentials(Request $request)
{
// ... lines 30 - 38
$data = $form->getData();
$request->getSession()->set(
Security::LAST_USERNAME,
$data['_username']
);
// ... lines 44 - 45
}
// ... lines 47 - 75
}
See Code Block in Script
// ... lines 1 - 10
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoder;
// ... lines 12 - 15
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 18 - 20
private $passwordEncoder;
public function __construct(FormFactoryInterface $formFactory, EntityManager $em, RouterInterface $router, UserPasswordEncoder $passwordEncoder)
{
// ... lines 25 - 27
$this->passwordEncoder = $passwordEncoder;
}
// ... lines 30 - 78
}
See Code Block in Script
// ... lines 1 - 15
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
{
// ... lines 18 - 58
public function checkCredentials($credentials, UserInterface $user)
{
// ... lines 61 - 62
if ($this->passwordEncoder->isPasswordValid($user, $password)) {
return true;
}
// ... lines 66 - 67
}
// ... lines 69 - 78
}
See Code Block in Script
// ... lines 1 - 2
{% block body %}
<div class="container">
<div class="row">
<div class="col-xs-12">
// ... lines 7 - 14
{{ form_start(form) }}
// ... lines 16 - 17
<button type="submit" class="btn btn-success">Login <span class="fa fa-lock"></span></button>
&nbsp;
<a href="{{ path('user_register') }}">Register</a>
{{ form_end(form) }}
</div>
</div>
</div>
{% endblock %}
See Code Block in Script
// ... lines 1 - 2
namespace AppBundle\Security;
// ... lines 4 - 11
use Symfony\Component\Security\Guard\AbstractGuardAuthenticator;
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 16 - 61
}
See Code Block in Script
// ... lines 1 - 7
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;
// ... lines 12 - 13
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
public function getCredentials(Request $request)
{
// ... lines 18 - 30
}
public function getUser($credentials, UserProviderInterface $userProvider)
{
// TODO: Implement getUser() method.
}
public function checkCredentials($credentials, UserInterface $user)
{
// TODO: Implement checkCredentials() method.
}
public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
{
// TODO: Implement onAuthenticationFailure() method.
}
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
{
// TODO: Implement onAuthenticationSuccess() method.
}
public function supportsRememberMe()
{
// TODO: Implement supportsRememberMe() method.
}
// ... lines 57 - 61
}
See Code Block in Script
// ... lines 1 - 5
use Symfony\Component\HttpFoundation\Request;
// ... lines 7 - 8
use Symfony\Component\Security\Core\Exception\AuthenticationException;
// ... lines 10 - 13
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
// ... lines 16 - 57
public function start(Request $request, AuthenticationException $authException = null)
{
// TODO: Implement start() method.
}
}
See Code Block in Script
// ... lines 1 - 13
class JwtTokenAuthenticator extends AbstractGuardAuthenticator
{
public function getCredentials(Request $request)
{
$extractor = new AuthorizationHeaderTokenExtractor(
'Bearer',
'Authorization'
);
// ... lines 22 - 30
}
// ... lines 32 - 61
}
See Code Block in Script
// ... lines 1 - 17
$extractor = new AuthorizationHeaderTokenExtractor(
'Bearer',
'Authorization'
);
$token = $extractor->extract($request);
// ... lines 24 - 63
See Code Block in Script
// ... lines 1 - 17
$extractor = new AuthorizationHeaderTokenExtractor(
'Bearer',
'Authorization'
);
$token = $extractor->extract($request);
if (!$token) {
return;
}
// ... lines 28 - 63
See Code Block in Script