blib/lib/HTML/FormFu/Validator/OpusVL/AppKit/CurrentPasswordValidator.pm

filter: Statementstmt 100% 14 / 14 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 95.2% 20 / 21 CC 2 SCAR 3.4
CC
2
Cov
100%
validate_value
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« blib/lib/OpusVL/AppKit/Form/Login.pm ↑ Summary blib/lib/OpusVL/AppKit/Builder.pm »
1 package HTML::FormFu::Validator::OpusVL::AppKit::CurrentPasswordValidator;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 ▶use base 'HTML::FormFu::Validator';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶sub validate_value {
Subroutine validate_value: called CC=2 SCAR=6.9
Pod undocumented
9 2 my ( $self, $value, $params ) = @_;
10  
11 2 my $c = $self->form->stash->{context};
12  
13 2 ▶ return 1 if($c->authenticate({ username => $c->user->username, password => $value }));
Branch: 1 branch
BranchTrueFalseTotal
if $c->authenticate({"username", $c->user->username, "password", $value}) 1 1 2
14  
15 1 die HTML::FormFu::Exception::Validator->new({
16 message => 'Invalid password',
17 });
18 }
19  
20 3 1;
21  
22 __END__
« blib/lib/OpusVL/AppKit/Form/Login.pm ↑ Summary blib/lib/OpusVL/AppKit/Builder.pm »