feat: authentification par code email pour contrats (verify/resend)
- Route /process/contrat/{id}/verify : saisie code 6 chiffres
- Code envoye par email au client, expire 15 minutes
- Bouton "Renvoyer le code"
- Protection process et sign derriere la verification session
- Template verify.html.twig + email contrat_verify_code.html.twig
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
32
templates/contrat/verify.html.twig
Normal file
32
templates/contrat/verify.html.twig
Normal file
@@ -0,0 +1,32 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Verification - Contrat {{ contrat.reference }} - Association E-Cosplay{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="min-h-screen flex items-center justify-center p-4" style="background: linear-gradient(135deg, #f5f5f0 0%, #e8e8e0 100%);">
|
||||
<div class="glass-heavy w-full max-w-md overflow-hidden">
|
||||
<div class="glass-dark text-white px-8 py-6 text-center">
|
||||
<h1 class="text-lg font-bold uppercase tracking-widest">Verification</h1>
|
||||
<p class="text-xs text-white/60 mt-1">{{ contrat.reference }} - Un code a ete envoye a {{ contrat.email }}</p>
|
||||
</div>
|
||||
<div class="p-8">
|
||||
{% if error %}
|
||||
<div class="mb-4 p-3 bg-red-500/20 text-red-700 font-bold text-xs">{{ error }}</div>
|
||||
{% endif %}
|
||||
<p class="text-sm text-gray-600 mb-4">Saisissez le code de verification a 6 chiffres recu par email pour acceder a votre contrat.</p>
|
||||
<form method="post" action="{{ path('app_contrat_verify', {id: contrat.id}) }}">
|
||||
<div class="mb-4">
|
||||
<label for="code" class="block text-[9px] font-bold uppercase tracking-wider text-gray-400 mb-1">Code de verification</label>
|
||||
<input type="text" id="code" name="code" maxlength="6" pattern="[0-9]{6}" required autofocus
|
||||
class="input-glass w-full px-4 py-3 text-center text-2xl font-bold tracking-[0.5em]" placeholder="000000">
|
||||
</div>
|
||||
<button type="submit" class="w-full btn-gold px-4 py-3 font-bold uppercase text-xs tracking-wider text-gray-900">Verifier</button>
|
||||
</form>
|
||||
<p class="text-center text-xs text-gray-400 mt-4">Le code expire dans 15 minutes.</p>
|
||||
<form method="post" action="{{ path('app_contrat_resend_code', {id: contrat.id}) }}" class="mt-3 text-center">
|
||||
<button type="submit" class="text-xs font-bold uppercase tracking-wider text-gray-500 hover:text-gray-900 underline transition-all">Renvoyer le code</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
14
templates/emails/contrat_verify_code.html.twig
Normal file
14
templates/emails/contrat_verify_code.html.twig
Normal file
@@ -0,0 +1,14 @@
|
||||
{% extends 'email/base.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<table width="600" cellpadding="0" cellspacing="0" style="margin: 0 auto;">
|
||||
<tr>
|
||||
<td style="padding: 32px; text-align: center;">
|
||||
<h1 style="font-family: Arial, Helvetica, sans-serif; font-size: 22px; font-weight: 700; color: #111827; margin: 0 0 16px;">Code de verification</h1>
|
||||
<p style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #374151; margin: 0 0 20px;">Contrat {{ contrat.reference }}</p>
|
||||
<div style="background: #111827; color: #fabf04; font-family: monospace; font-size: 36px; font-weight: 700; letter-spacing: 12px; padding: 20px; display: inline-block;">{{ code }}</div>
|
||||
<p style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #9ca3af; margin: 20px 0 0;">Ce code expire dans 15 minutes.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user