diff --git a/.dockerignore b/.dockerignore index 0459cf6..b401666 100644 --- a/.dockerignore +++ b/.dockerignore @@ -7,8 +7,7 @@ node_modules/ .env.*.local # Cache et logs Symfony -var/cache/ -var/log/ +var # Build front-end public/build/ diff --git a/config/packages/security.yaml b/config/packages/security.yaml index c23148d..365d84e 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -22,7 +22,7 @@ security: form_login: login_path: app_login check_path: app_login - enable_csrf: true + enable_csrf: false csrf_token_id: authenticate csrf_parameter: _csrf_token default_target_path: / diff --git a/misc/docker/Dockerfile b/misc/docker/Dockerfile index b2f50d4..0fedc4b 100644 --- a/misc/docker/Dockerfile +++ b/misc/docker/Dockerfile @@ -11,9 +11,10 @@ COPY ./misc/docker/apache.conf /etc/apache2/conf.d/nine/site.conf WORKDIR /app # Crée vendor à l’avance et donne les droits -RUN mkdir -p /app/vendor && chown -R apache:apache /app +RUN mkdir -p /app/vendor && mkdir -p /app/var && chown -R apache:apache /app USER apache +WORKDIR /app COPY --chown=apache:apache . . RUN composer install --no-interaction diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index 6ae6501..da9adb3 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -12,7 +12,6 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; use Symfony\Component\Routing\Attribute\Route; -use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; class UserController extends AbstractController { @@ -126,11 +125,8 @@ class UserController extends AbstractController } #[Route('/user', name: 'app_user_profil')] - public function profil(CsrfTokenManagerInterface $csrfTokenManager, Request $request, UserPasswordHasherInterface $passwordHasher, EntityManagerInterface $em): Response + public function profil(Request $request, UserPasswordHasherInterface $passwordHasher, EntityManagerInterface $em): Response { - $token = $csrfTokenManager->getToken('user')->getValue(); - dump($token); - $user = $em->getRepository(User::class)->find($this->getUser()); if (!$user) { return $this->redirectToRoute('app_home'); diff --git a/src/Form/UserType.php b/src/Form/UserType.php index 8d1a4ea..1be2678 100644 --- a/src/Form/UserType.php +++ b/src/Form/UserType.php @@ -31,11 +31,6 @@ class UserType extends AbstractType 'label' => 'Login', ]) - ->add('apikey', TextType::class, [ - 'label' => 'apikey', - 'required' => false, - ]) - ->add('avatar', HiddenType::class) ->add('email', EmailType::class, [ @@ -56,6 +51,7 @@ class UserType extends AbstractType 'choice_label' => 'title', 'multiple' => true, 'attr' => ['class' => 'select2'], + 'required' => false, ]); } diff --git a/src/Security/DynamicAuthenticator.php b/src/Security/DynamicAuthenticator.php index fab1342..6a8e21c 100644 --- a/src/Security/DynamicAuthenticator.php +++ b/src/Security/DynamicAuthenticator.php @@ -104,11 +104,11 @@ class DynamicAuthenticator extends AbstractAuthenticator // \phpCAS::setDebug('/tmp/logcas.log'); \phpCAS::client( - CAS_VERSION_2_0, - $this->parameterBag->get('casHost'), - (int) $this->parameterBag->get('casPort'), - $this->parameterBag->get('casPath'), - $url, + CAS_VERSION_2_0, + $this->parameterBag->get('casHost'), + (int) $this->parameterBag->get('casPort'), + $this->parameterBag->get('casPath'), + $url, false); \phpCAS::setNoCasServerValidation(); diff --git a/templates/user/edit.html.twig b/templates/user/edit.html.twig index 3a868a2..87a3ab4 100644 --- a/templates/user/edit.html.twig +++ b/templates/user/edit.html.twig @@ -32,13 +32,6 @@ {{ form_row(form.email) }} - -