@@ -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); | |||
} | |||
} | |||
} |
@@ -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 | |||
]); | |||
} | |||
@@ -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') |
@@ -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%} |
@@ -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": [ | |||
{ |