Branch Coverage

blib/lib/Yancy/Plugin/Auth/Password.pm
Criterion Covered Total %
branch 47 64 73.4


line true false branch
451 0 11 if $config->{'collection'}
453 0 11 unless $schema
475 10 1 unless $field->{'x-filter'}
10 1 unless (grep {$_ eq "yancy.plugin.auth.password";} @{[] unless $field->{'x-filter'};})
489 2 20 unless (grep {$_ eq $field;} @{$self->register_fields;})
510 3 31 if (my $field = $self->plugin_field)
513 34 0 if ($username_field)
533 0 1 if ($@)
550 0 1 if ($username_field and $username_field ne $id_field)
558 0 35 unless my $session = $c->session
559 17 18 unless my $yancy = $session->{'yancy'}
560 1 17 unless my $auth = $yancy->{'auth'}
561 0 17 unless my $username = $auth->{'password'}
569 3 10 $c->current_route =~ /^yancy\.auth/u && $c->req->headers->referrer && !($c->req->headers->referrer =~ m[^(?:\w+:|//)]u) ? :
1 13 $c->flash('return_to') ? :
3 14 $c->req->param('return_to') ? :
583 0 17 if ($return_to =~ m[^(?:\w+:|//)]u)
606 11 3 if ($self->_check_pass($c, $user, $pass))
612 2 9 if ($to =~ m[^(?:\w+:|//)]u)
632 0 1 unless ($self->allow_register)
644 0 4 unless ($self->allow_register)
657 1 3 if ($pass ne $c->param($self->password_field . "-verify"))
665 1 2 if ($self->_get_user($c, $username))
685 1 1 if (my $exception = $@)
686 1 0 ref $exception eq 'ARRAY' ? :
707 0 17 if (my $error = $@)
708 0 0 if ($error =~ m[Can't locate Digest/$type\.pm in \@INC]u)
734 1 13 unless ($user)
746 0 13 unless ($user_digest_config_string)
758 0 13 if ($@)
766 1 10 if ($success and $force_upgrade || $user_digest_config_string ne $default_config_string)
785 0 3 if ($redirect_to eq $c->req->url->path)