Compare commits
13 commits
Author | SHA1 | Date | |
---|---|---|---|
ce4deb24f8 | |||
79c799748b | |||
b20d542dc3 | |||
c19dc624c7 | |||
8e7a7e25a1 | |||
01622180be | |||
f3f4417d7c | |||
027b7df80e | |||
a8ab2d3945 | |||
76a8cf1751 | |||
8ff8ec9dac | |||
8518b05b8d | |||
Simon Vieille | 7e8281aa8f |
|
@ -17,55 +17,61 @@
|
|||
"doctrine/doctrine-migrations-bundle": "^3.2",
|
||||
"doctrine/orm": "^2.11",
|
||||
"fusonic/opengraph": "^2.2",
|
||||
"friendsofsymfony/jsrouting-bundle": "^2.8",
|
||||
"friendsofsymfony/jsrouting-bundle": "^3.2",
|
||||
"jaybizzle/crawler-detect": "^1.2",
|
||||
"knplabs/doctrine-behaviors": "^2.6",
|
||||
"knplabs/knp-paginator-bundle": "^5.8",
|
||||
"liip/imagine-bundle": "^2.7",
|
||||
"matomo/device-detector": "^5.0",
|
||||
"phpdocumentor/reflection-docblock": "^5.3",
|
||||
"scheb/2fa-google-authenticator": "^5.13",
|
||||
"scheb/2fa-qr-code": "^5.13",
|
||||
"scheb/2fa-bundle": "^6.5",
|
||||
"sensio/framework-extra-bundle": "^6.2",
|
||||
"sensiolabs/ansi-to-html": "^1.2",
|
||||
"spe/filesize-extension-bundle": "~2.0.0",
|
||||
"stof/doctrine-extensions-bundle": "^1.7",
|
||||
"symfony/apache-pack": "^1.0",
|
||||
"symfony/asset": "5.4.*",
|
||||
"symfony/console": "5.4.*",
|
||||
"symfony/dotenv": "5.4.*",
|
||||
"symfony/event-dispatcher": "5.4.*",
|
||||
"symfony/expression-language": "5.4.*",
|
||||
"symfony/finder": "5.4.*",
|
||||
"symfony/asset": "6.2.*",
|
||||
"symfony/console": "6.2.*",
|
||||
"symfony/dotenv": "6.2.*",
|
||||
"symfony/event-dispatcher": "6.2.*",
|
||||
"symfony/expression-language": "6.2.*",
|
||||
"symfony/finder": "6.2.*",
|
||||
"symfony/form": "6.2.*",
|
||||
"symfony/framework-bundle": "6.2.*",
|
||||
"symfony/http-client": "6.2.*",
|
||||
"symfony/intl": "6.2.*",
|
||||
"symfony/mailer": "6.2.*",
|
||||
"symfony/mime": "6.2.*",
|
||||
"symfony/flex": "^2.2",
|
||||
"symfony/form": "5.4.*",
|
||||
"symfony/framework-bundle": "5.4.*",
|
||||
"symfony/http-client": "5.4.*",
|
||||
"symfony/intl": "5.4.*",
|
||||
"symfony/mailer": "5.4.*",
|
||||
"symfony/mime": "5.4.*",
|
||||
"symfony/monolog-bundle": "^3.1",
|
||||
"symfony/notifier": "5.4.*",
|
||||
"symfony/process": "5.4.*",
|
||||
"symfony/property-access": "5.4.*",
|
||||
"symfony/property-info": "5.4.*",
|
||||
"symfony/proxy-manager-bridge": "5.4.*",
|
||||
"symfony/security-bundle": "5.4.*",
|
||||
"symfony/serializer": "5.4.*",
|
||||
"symfony/string": "5.4.*",
|
||||
"symfony/translation": "5.4.*",
|
||||
"symfony/twig-bundle": "^5.2",
|
||||
"symfony/validator": "5.4.*",
|
||||
"symfony/web-link": "5.4.*",
|
||||
"symfony/notifier": "6.2.*",
|
||||
"symfony/process": "6.2.*",
|
||||
"symfony/property-access": "6.2.*",
|
||||
"symfony/property-info": "6.2.*",
|
||||
"symfony/proxy-manager-bridge": "6.2.*",
|
||||
"symfony/security-bundle": "6.2.*",
|
||||
"symfony/serializer": "6.2.*",
|
||||
"symfony/string": "6.2.*",
|
||||
"symfony/translation": "6.2.*",
|
||||
"symfony/twig-bundle": "^6.0",
|
||||
"symfony/validator": "6.2.*",
|
||||
"symfony/web-link": "6.2.*",
|
||||
"symfony/webpack-encore-bundle": "^1.11",
|
||||
"symfony/yaml": "5.4.*",
|
||||
"symfony/yaml": "6.2.*",
|
||||
"twig/extra-bundle": "^2.12|^3.3",
|
||||
"twig/twig": "^2.12|^3.3",
|
||||
"symfony/runtime": "^5.4"
|
||||
"symfony/runtime": "6.2.*",
|
||||
"scheb/2fa-totp": "^6.5"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"App\\Core\\": "src/core/"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"symfony/flex": false,
|
||||
"symfony/runtime": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,10 +16,14 @@ use Symfony\Component\Security\Core\User\UserInterface;
|
|||
use Symfony\Component\Security\Core\User\UserProviderInterface;
|
||||
use Symfony\Component\Security\Csrf\CsrfToken;
|
||||
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
|
||||
use Symfony\Component\Security\Guard\Authenticator\AbstractFormLoginAuthenticator;
|
||||
use Symfony\Component\Security\Http\Util\TargetPathTrait;
|
||||
use Symfony\Component\Security\Http\Authenticator\AbstractLoginFormAuthenticator;
|
||||
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
|
||||
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\Badge\CsrfTokenBadge;
|
||||
|
||||
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
|
||||
class LoginFormAuthenticator extends AbstractLoginFormAuthenticator
|
||||
{
|
||||
use TargetPathTrait;
|
||||
|
||||
|
@ -39,11 +43,26 @@ class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
|
|||
$this->passwordEncoder = $passwordEncoder;
|
||||
}
|
||||
|
||||
public function supports(Request $request)
|
||||
public function supports(Request $request): bool
|
||||
{
|
||||
return 'auth_login' === $request->attributes->get('_route') && $request->isMethod('POST');
|
||||
}
|
||||
|
||||
public function authenticate(Request $request): Passport
|
||||
{
|
||||
$id = $request->request->get('id', '');
|
||||
|
||||
$request->getSession()->set(Security::LAST_USERNAME, $id);
|
||||
|
||||
return new Passport(
|
||||
new UserBadge($id),
|
||||
new PasswordCredentials($request->request->get('password', '')),
|
||||
[
|
||||
new CsrfTokenBadge('authenticate', $request->request->get('_csrf_token')),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function getCredentials(Request $request)
|
||||
{
|
||||
$credentials = [
|
||||
|
@ -80,7 +99,7 @@ class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
|
|||
return $this->passwordEncoder->isPasswordValid($user, $credentials['password']);
|
||||
}
|
||||
|
||||
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
|
||||
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey): RedirectResponse
|
||||
{
|
||||
if ($targetPath = $this->getTargetPath($request->getSession(), $providerKey)) {
|
||||
return new RedirectResponse($targetPath);
|
||||
|
@ -89,7 +108,7 @@ class LoginFormAuthenticator extends AbstractFormLoginAuthenticator
|
|||
return new RedirectResponse($this->urlGenerator->generate('admin_dashboard_index'));
|
||||
}
|
||||
|
||||
protected function getLoginUrl()
|
||||
protected function getLoginUrl(Request $request): string
|
||||
{
|
||||
return $this->urlGenerator->generate('auth_login');
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ class FilePickerType extends AbstractType
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'file_picker';
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ class CollectionType extends BaseCollectionType
|
|||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'murph_collection';
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ class GrapesJsType extends TextareaType
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'grapesjs';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue