NAME

Plack::Middleware::CSRFBlock - Block CSRF Attacks with minimal changes to your app

VERSION

version 0.10

SYNOPSIS

use Plack::Builder;

my $app = sub { ... }

builder {
  enable 'Session';
  enable 'CSRFBlock';
  $app;
}

DESCRIPTION

This middleware blocks CSRF. You can use this middleware without any modifications to your application, in most cases. Here is the strategy:

OPTIONS

use Plack::Builder;

my $app = sub { ... }

builder {
  enable 'Session';
  enable 'CSRFBlock',
    parameter_name => 'csrf_secret',
    token_length => 20,
    session_key => 'csrf_token',
    blocked => sub {
      [302, [Location => 'http://www.google.com'], ['']];
    },
    onetime => 0,
    ;
  $app;
}

SEE ALSO

Plack::Middleware::Session

AUTHORS

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by the Authors of Plack-Middleware-CSRFBlock.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.