CatalystX::Usul::Plugin::Controller::TokenValidation - CSRF form tokens
Describes v0.16.$Rev: 1 $
# In custom action class if ($controller->can( q(validate_token) ) && _should_validate( $c )) { unless ($controller->validate_token( $c )) { return $self->_invalid_token( @args ) ? $self->next::method( @rest ) : undef; } $controller->remove_token( $c ); }
Generates and validates CSRF form tokens
Requires; end and redirect_to_path methods
end
redirect_to_path
Controller methods with the NoToken code attribute do not have a token added
NoToken
Around the controller end method, adds a CSRF token to the form
Removes the validated token from the form so that it is not mistaken for a regular input field
Checks to see if the token stored in the session matches the one posted back in the form
None
There are no known incompatibilities in this module
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Peter Flanigan, <Support at RoxSoft.co.uk>
<Support at RoxSoft.co.uk>
Copyright (c) 2014 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
To install CatalystX::Usul, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CatalystX::Usul
CPAN shell
perl -MCPAN -e shell install CatalystX::Usul
For more information on module installation, please visit the detailed CPAN module installation guide.