diff --git a/config/packages/security.yaml b/config/packages/security.yaml index bfb5e2fd38196cb317204f5d9ca10a6bd675a606..5d52eb4be0301f5b290a61640ce82d1be93a3ffd 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -36,5 +36,5 @@ security: # Easy way to control access for large sections of your site # Note: Only the *first* access control that matches will be used access_control: - # - { path: ^/admin, roles: ROLE_ADMIN } - # - { path: ^/profile, roles: ROLE_USER } + - { path: ^/my_capsules, roles: ROLE_USER } + diff --git a/src/Controller/CapsuleController.php b/src/Controller/CapsuleController.php index 4449135b0d8e5740f6051fef89588f5feba3ad7e..86801946d11b454caedb7be07b9419e622f18eda 100644 --- a/src/Controller/CapsuleController.php +++ b/src/Controller/CapsuleController.php @@ -13,10 +13,6 @@ class CapsuleController extends AbstractController */ public function index(): Response { - if (! $this->getUser()) { - return $this->redirectToRoute('app_login'); - } - return $this->render('capsule/index.html.twig', [ 'controller_name' => 'CapsuleController', ]); diff --git a/tests/functional/RegistrationControllerTest.php b/tests/functional/RegistrationControllerTest.php index da92490abbf881c427bb4d643cfaad971b6f1755..30bd7bc1147154bb48993fdd2081111af5dd2d29 100644 --- a/tests/functional/RegistrationControllerTest.php +++ b/tests/functional/RegistrationControllerTest.php @@ -44,7 +44,7 @@ class RegistrationControllerTest extends WebTestCase $this->registerUser($userEmail, $client); - $this->checkEmailHasBeenSentAndGetEmail($userEmail); + $this->checkEmailHasBeenSentAndGetEmailMessage($userEmail); } public function testEmailValidationRegistrationShouldEnableUser(): void @@ -53,7 +53,7 @@ class RegistrationControllerTest extends WebTestCase $client = static::createClient(); $this->registerUser($userEmail, $client); - $emailMessage = $this->checkEmailHasBeenSentAndGetEmail($userEmail); + $emailMessage = $this->checkEmailHasBeenSentAndGetEmailMessage($userEmail); $client->followRedirect(); $this->clickOnEmailMessageLink($emailMessage, $client); @@ -81,7 +81,7 @@ class RegistrationControllerTest extends WebTestCase * @param string $userEmail The registered user email * @return RawMessage The email message sent to the user */ - private function checkEmailHasBeenSentAndGetEmail(string $userEmail): RawMessage + private function checkEmailHasBeenSentAndGetEmailMessage(string $userEmail): RawMessage { $this->assertEmailCount( 1,