summaryrefslogtreecommitdiff
path: root/index.pl
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-03-08 16:54:54 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-03-08 16:54:54 +0100
commitbf4ccb0eabe0f4258bc174a83dfba318d0212af1 (patch)
tree1e655374478df55eea4a1a21c6af4a2e69331ec7 /index.pl
parentfd608391164ddc9e55e2f383620d395b43ae99b7 (diff)
Logout: Use a POST form as it's a stateful action
Diffstat (limited to 'index.pl')
-rwxr-xr-xindex.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/index.pl b/index.pl
index 69d1079..6331d45 100755
--- a/index.pl
+++ b/index.pl
@@ -1176,6 +1176,10 @@ get '/export.json' => sub {
post '/logout' => sub {
my ($self) = @_;
+ if ( $self->validation->csrf_protect->has_error('csrf_token') ) {
+ $self->render( 'login', invalid => 'csrf' );
+ return;
+ }
$self->logout;
$self->redirect_to('/login');
};