Browse Source

Adaptation avec Erg et Oroshi

feature/symfony6.1
Fabien Normand 3 months ago
parent
commit
419923729f
5 changed files with 14 additions and 5 deletions
  1. +7
    -2
      Authenticator/LoginFormAuthenticator.php
  2. +1
    -0
      Controller/Security/SecurityAdminController.php
  3. +2
    -0
      DependencyInjection/Configuration.php
  4. +2
    -1
      Resources/assets/app/adminlte/main/scss/_common.scss
  5. +2
    -2
      composer.json

+ 7
- 2
Authenticator/LoginFormAuthenticator.php View File

@@ -13,6 +13,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Exception\CustomUserMessageAccountStatusException;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Security\Http\Authenticator\AbstractLoginFormAuthenticator;
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\CsrfTokenBadge;
@@ -62,7 +63,11 @@ class LoginFormAuthenticator extends AbstractLoginFormAuthenticator

return new Passport(
new UserBadge($email, function ($userIdentifier) {
return $this->userStore->getOneByEmail($userIdentifier);
$foundUser = $this->userStore->getOneByEmail($userIdentifier);
if ($foundUser && !$foundUser->isVerified()) {
throw new CustomUserMessageAccountStatusException('Votre compte n\'est pas encore activé, vérifier vos emails');
}
return $foundUser;
}),
new PasswordCredentials($password),
[
@@ -115,4 +120,4 @@ class LoginFormAuthenticator extends AbstractLoginFormAuthenticator
{
return $this->urlGenerator->generate(self::LOGIN_ROUTE);
}
}
}

+ 1
- 0
Controller/Security/SecurityAdminController.php View File

@@ -61,6 +61,7 @@ class SecurityAdminController extends AbstractController

// the 'name' HTML attribute of the <input> used for the password field (default: '_password')
'password_parameter' => 'password',
'forgot_password_enabled' => true
]);
}


+ 2
- 0
DependencyInjection/Configuration.php View File

@@ -24,6 +24,8 @@ class Configuration implements ConfigurationInterface
->children()
//->scalarNode('dashboard_default')->defaultValue('App\Controller\Admin\DashboardController')->end()
->scalarNode('homepage_route')->end()
->scalarNode('email_notification')->end()
->scalarNode('email_notification_name')->end()
->arrayNode('login_redirection')
->children()
->scalarNode('redirect_referer')

+ 2
- 1
Resources/assets/app/adminlte/main/scss/_common.scss View File

@@ -1,3 +1,4 @@

.logo-admin {
max-width: 100%;
}
@@ -151,4 +152,4 @@ table.fixedHeader-floating {
display: table;
}
.lc-draggable{width: 100%;}
.sortable{width: 100%}
.sortable{width: 100%}

+ 2
- 2
composer.json View File

@@ -1,9 +1,9 @@
{
"name": "lc/admin-bundle",
"name": "laclic/sov-bundle",
"type": "symfony-bundle",
"description": "Administration for Symfony applications based on easyadmin",
"keywords": ["backend", "admin", "generator"],
"homepage": "https://gitea.laclic.fr/Laclic/SovBundle",
"homepage": "https://forge.laclic.fr/Laclic/SovBundle",
"license": "MIT",
"authors": [
{

Loading…
Cancel
Save