```
♻️ refactor: Supprime la gestion de la déconnexion et simplifie l'authentification.
```
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import './app.scss'
|
||||
//import * as Turbo from "@hotwired/turbo"
|
||||
import * as Turbo from "@hotwired/turbo"
|
||||
|
||||
import {PaymentForm} from './PaymentForm'
|
||||
import * as Sentry from "@sentry/browser";
|
||||
|
||||
@@ -10,6 +10,7 @@ framework:
|
||||
#fragments: true
|
||||
trusted_proxies: '103.21.244.0/22,103.22.200.0/22,103.31.4.0/22,104.16.0.0/13,104.24.0.0/14,108.162.192.0/18,131.0.72.0/22,141.101.64.0/18,162.158.0.0/15,172.64.0.0/13,173.245.48.0/20,188.114.96.0/20,190.93.240.0/20,197.234.240.0/22,198.41.128.0/17'
|
||||
trusted_headers: [ 'x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port', 'x-forwarded-prefix' ]
|
||||
|
||||
when@test:
|
||||
framework:
|
||||
test: true
|
||||
|
||||
@@ -27,9 +27,6 @@ security:
|
||||
entry_point: App\Security\LoginFormAuthenticator
|
||||
custom_authenticators:
|
||||
- App\Security\LoginFormAuthenticator
|
||||
logout:
|
||||
path: app_logout # La route pour la déconnexion
|
||||
target: app_login # Redirection après déconnexion réussie
|
||||
|
||||
|
||||
# Configuration des algorithmes de hachage des mots de passe.
|
||||
|
||||
@@ -64,11 +64,6 @@ class SecurityController extends AbstractController
|
||||
return $this->render('security/forgot_password.twig', [
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
#[Route(path: '/logout', name: 'app_logout', options: ['sitemap' => false], methods: ['GET','POST'])]
|
||||
public function logout(): Response
|
||||
{
|
||||
|
||||
}
|
||||
#[Route(path: '/mot-de-passe-oublie/sent', name: 'app_forgot_password_sent', options: ['sitemap' => false], methods: ['GET','POST'])]
|
||||
public function forgotPasswordSent(Request $request,EventDispatcherInterface $eventDispatcher): Response
|
||||
|
||||
@@ -46,7 +46,6 @@ class SeoController extends AbstractController
|
||||
$robots->addDisallow($this->generateUrl('app_cgu'));
|
||||
$robots->addDisallow($this->generateUrl('app_cgv'));
|
||||
$robots->addDisallow($this->generateUrl('app_login'));
|
||||
$robots->addDisallow($this->generateUrl('app_logout'));
|
||||
$robots->addDisallow($this->generateUrl('app_forgot_password'));
|
||||
|
||||
$robots->addSpacer();
|
||||
|
||||
@@ -69,11 +69,7 @@ class LoginFormAuthenticator extends AbstractLoginFormAuthenticator
|
||||
// 2. Credentials: Vérifie le mot de passe
|
||||
new PasswordCredentials($request->request->get('_password', '')),
|
||||
[
|
||||
// 3. CsrfTokenBadge: Vérifie le jeton CSRF (l'ID 'authenticate' doit correspondre au Twig)
|
||||
new CsrfTokenBadge('authenticate', $request->request->get('_csrf_token')),
|
||||
|
||||
// 4. RememberMeBadge: Ajoute le support du "Se souvenir de moi"
|
||||
new RememberMeBadge(),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -100,11 +100,7 @@ L'overflow-y-auto n'est plus nécessaire ici car c'est le <body> qui gère le sc
|
||||
{% endif %}
|
||||
</span>
|
||||
|
||||
<!-- Bouton Déconnexion -->
|
||||
<a href="{{ path('app_logout') }}" class="ml-4 p-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition duration-150 flex items-center shadow-md">
|
||||
<svg class="w-5 h-5 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"></path></svg>
|
||||
Déconnexion
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -223,11 +223,7 @@
|
||||
tabindex="-1">
|
||||
{{ 'logged_admin'|trans }}
|
||||
</a>
|
||||
<a href="{{ path('app_logout') }}"
|
||||
class="block px-4 py-2 text-sm text-red-600 hover:bg-gray-100" role="menuitem"
|
||||
tabindex="-1">
|
||||
{{ 'logout_link'|trans }}
|
||||
</a>
|
||||
|
||||
{% else %}
|
||||
{# Afficher la connexion si non connecté #}
|
||||
<a href="{{ path('app_login') }}"
|
||||
@@ -265,11 +261,7 @@
|
||||
class="block px-4 py-2 text-sm text-gray-900 font-semibold border-b border-gray-100">
|
||||
{{ 'logged_in_as'|trans }} {{ app.user.username|default('Compte') }}
|
||||
</div>
|
||||
<a href="{{ path('app_logout') }}"
|
||||
class="block px-4 py-2 text-sm text-red-600 hover:bg-gray-100" role="menuitem"
|
||||
tabindex="-1">
|
||||
{{ 'logout_link'|trans }}
|
||||
</a>
|
||||
|
||||
{% else %}
|
||||
<a href="{{ path('app_login') }}"
|
||||
class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" role="menuitem"
|
||||
|
||||
@@ -70,14 +70,6 @@
|
||||
|
||||
{# Remember Me & Forgot Password (Optional) #}
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center">
|
||||
<input id="remember_me" name="_remember_me" type="checkbox"
|
||||
class="h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded">
|
||||
<label for="remember_me" class="ml-2 block text-sm text-gray-900">
|
||||
{{ 'label.remember_me'|trans }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="text-sm">
|
||||
<a href="{{ path('app_forgot_password') }}" class="font-medium text-indigo-600 hover:text-indigo-500">
|
||||
{{ 'link.forgot_password'|trans }}
|
||||
|
||||
Reference in New Issue
Block a user