lock registration
This commit is contained in:
parent
79afe43010
commit
edf48de9b7
2 changed files with 3 additions and 0 deletions
|
|
@ -37,6 +37,7 @@ security:
|
||||||
# Note: Only the *first* matching rule is applied
|
# Note: Only the *first* matching rule is applied
|
||||||
access_control:
|
access_control:
|
||||||
- { path: ^/brain, roles: ROLE_ADMIN }
|
- { path: ^/brain, roles: ROLE_ADMIN }
|
||||||
|
- { path: /letmein/register, roles: ROLE_ADMIN }
|
||||||
# - { path: ^/profile, roles: ROLE_USER }
|
# - { path: ^/profile, roles: ROLE_USER }
|
||||||
|
|
||||||
when@test:
|
when@test:
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ class RegistrationController extends AbstractController
|
||||||
#[Route('/letmein/register', name: 'app_register')]
|
#[Route('/letmein/register', name: 'app_register')]
|
||||||
public function register(Request $request, UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager): Response
|
public function register(Request $request, UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
|
$this->denyAccessUnlessGranted('ROLE_ADMIN');
|
||||||
|
|
||||||
$user = new User();
|
$user = new User();
|
||||||
$form = $this->createForm(RegistrationFormType::class, $user);
|
$form = $this->createForm(RegistrationFormType::class, $user);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue