Added CSRF protection
This commit is contained in:
@@ -32,6 +32,10 @@
|
||||
<a href="/admin/edit/{{ post.id }}" class="btn btn-sm btn-secondary">Éditer</a>
|
||||
|
||||
<form method="post" action="/admin/delete/{{ post.id }}" style="display:inline;">
|
||||
{# Tokens CSRF #}
|
||||
<input type="hidden" name="{{ csrf.keys.name }}" value="{{ csrf.name }}">
|
||||
<input type="hidden" name="{{ csrf.keys.value }}" value="{{ csrf.value }}">
|
||||
|
||||
<button type="submit" class="btn btn-sm btn-danger"
|
||||
onclick="return confirm('Supprimer cet article ?')">
|
||||
Supprimer
|
||||
|
||||
@@ -20,6 +20,10 @@ Créer un article
|
||||
|
||||
{# Formulaire identifié pour le script JavaScript #}
|
||||
<form id="articleForm" method="post" action="{{ action }}">
|
||||
{# Tokens CSRF #}
|
||||
<input type="hidden" name="{{ csrf.keys.name }}" value="{{ csrf.name }}">
|
||||
<input type="hidden" name="{{ csrf.keys.value }}" value="{{ csrf.value }}">
|
||||
|
||||
<p>
|
||||
<label for="title">Titre<br>
|
||||
<input type="text" id="title" name="title" value="{{ post.title|default('') }}" required maxlength="255">
|
||||
|
||||
Reference in New Issue
Block a user