From 56342f21d27295e98327be4b49e54205b7a02e13 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 18 Mar 2019 18:55:39 +0100 Subject: demand a valid password for account deletion --- templates/account.html.ep | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) (limited to 'templates/account.html.ep') diff --git a/templates/account.html.ep b/templates/account.html.ep index 4917961..17b5e48 100644 --- a/templates/account.html.ep +++ b/templates/account.html.ep @@ -1,3 +1,30 @@ +% if (my $invalid = stash('invalid')) { +
+
+
+
+ % if ($invalid eq 'csrf') { + Ungültiger CSRF-Token +

Sind Cookies aktiviert? Ansonsten könnte es sich um einen + Fall von CSRF + handeln.

+ % } + % elsif ($invalid eq 'password') { + Ungültiges Passwort +

Aus Sicherheitsgründen kann der Account nur nach Passworteingabe + gelöscht werden.

+ % } + % else { + Unbekannter Fehler +

„<%= $invalid %>“

+ % } +
+
+
+
+% } +

Account

% my $acc = current_user();
@@ -192,17 +219,18 @@
-
-
-
- %= form_for 'delete' => begin + %= form_for 'delete' => begin +
+ lock + %= password_field 'password', id => 'password', class => 'validate', required => undef, autocomplete => 'current-password' + +
+
%= csrf_field - %= end -
-
-
+
+ %= end
% } -- cgit v1.2.3