From c44d44e4fcbe3326e7d5dd305bcc86ac3c21f34e Mon Sep 17 00:00:00 2001 From: Serreau Jovann Date: Fri, 16 Jan 2026 10:11:07 +0100 Subject: [PATCH] =?UTF-8?q?```=20=E2=9C=A8=20feat(scheb=5F2fa):=20Active?= =?UTF-8?q?=20Google=202FA=20et=20ajoute=20template=20de=20login?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Active l'authentification à deux facteurs Google et ajoute un template Twig pour l --- config/packages/scheb_2fa.yaml | 5 +- templates/security/2fa_login.html.twig | 100 +++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 templates/security/2fa_login.html.twig diff --git a/config/packages/scheb_2fa.yaml b/config/packages/scheb_2fa.yaml index 194a218..0d62882 100644 --- a/config/packages/scheb_2fa.yaml +++ b/config/packages/scheb_2fa.yaml @@ -1,15 +1,16 @@ # See the configuration reference at https://symfony.com/bundles/SchebTwoFactorBundle/6.x/configuration.html scheb_two_factor: + security_tokens: - Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken - Symfony\Component\Security\Http\Authenticator\Token\PostAuthenticationToken backup_codes: enabled: true - email: - enabled: true + google: enabled: true server_name: "Intranet Ludikevent" issuer: "Ludikevent" digits: 6 leeway: 0 + template: "security/2fa_login.html.twig" diff --git a/templates/security/2fa_login.html.twig b/templates/security/2fa_login.html.twig new file mode 100644 index 0000000..9ab9c37 --- /dev/null +++ b/templates/security/2fa_login.html.twig @@ -0,0 +1,100 @@ +{% extends 'base.twig' %} + +{% block title %}Vérification Sécurisée - Ludikevent{% endblock %} + +{% block body %} +
+
+ + {# Logo Ludikevent #} +
+ Ludikevent +
+ + {# Icône de sécurité #} +
+ + + +
+ +

Double Vérification

+ + {# Sélection du provider si plusieurs sont actifs (ex: Email + Google) #} + {% if availableTwoFactorProviders|length > 1 %} +

+ {{ "choose_provider"|trans({}, 'SchebTwoFactorBundle') }}: + {% for provider in availableTwoFactorProviders %} + {{ provider }} + {% endfor %} +

+ {% endif %} + +

+ Saisissez le code de validation {{ twoFactorProvider }} pour confirmer votre identité. +

+ +
+ + {# Gestion des erreurs d'authentification #} + {% if authenticationError %} +
+ {{ authenticationError|trans(authenticationErrorData, 'SchebTwoFactorBundle') }} +
+ {% endif %} + + {# Champ du code #} +
+ +
+ + {# Option "Faire confiance à ce navigateur" #} + {% if displayTrustedOption %} +
+ +
+ {% endif %} + + {# Protection CSRF #} + {% if isCsrfProtectionEnabled %} + + {% endif %} + + + + {# Lien d'annulation / déconnexion #} + +
+
+
+ + +{% endblock %}