Branch Coverage

blib/lib/Mojolicious/Plugin/OAuth2/Server.pm
Criterion Covered Total %
branch 78 94 82.9


line true false branch
169 0 22 if ($config->{'users'} and not $config->{'jwt_secret'})
239 34 71 if (ref $oauth_details)
260 26 22 $scope ? :
262 6 36 unless (defined $client_id and defined $type and $type =~ /^(code|token)$/)
280 11 25 $type eq 'token' ? :
291 19 17 if ($res)
293 2 17 if (not $Grant->login_resource_owner('mojo_controller', $self, 'client_id', $client_id)) { }
307 1 16 if (not defined $res) { }
1 15 elsif ($res == 0) { }
320 15 18 if ($res) { }
18 0 elsif ($error) { }
322 3 12 if $type eq "token"
349 2 16 if $error_description
358 28 2 if defined $state
360 0 30 $is_helper ? :
366 3 0 $Grant->can('get_access_token_ttl') ? :
391 2 1 $state ? :
402 1 2 $is_helper ? :
418 21 51 unless _access_token_request_check_params($self, $grant_type, $username, $password, $auth_code, $uri)
425 12 32 $grant_type eq 'client_credentials' ? :
7 44 $grant_type eq 'password' ? :
434 23 28 if ($client) { }
28 0 elsif ($error) { }
436 0 23 ref $client ? :
438 23 0 $Grant->can('get_access_token_ttl') ? :
461 20 3 $grant_type ne 'password' ? :
3 20 $grant_type eq 'client_credentials' ? :
487 2 13 ref $scope eq 'HASH' ? :
15 8 !$old_refresh_token && $scope ? :
3 20 $grant_type eq 'client_credentials' ? :
502 1 27 if $error_description
505 0 0 $grant_type eq 'client_credentials' ? :
0 0 $grant_type eq 'password' ? :
527 7 65 if ($grant_type eq 'password') { }
13 52 elsif ($grant_type eq 'client_credentials') { }
20 41 elsif ($grant_type ne 'authorization_code' and $grant_type ne 'refresh_token' or $grant_type eq 'authorization_code' and not defined $auth_code or $grant_type eq 'authorization_code' and not defined $uri) { }
530 0 0 unless ($username or $password)
547 1 12 unless ($client_id and $client_secret)
587 7 18 if (my $auth_header = $self->req->headers->header('Authorization')) { }
18 0 elsif ($client_id = $self->req->param('client_id')) { }
588 7 0 if (my($encoded_details) = (split(/Basic /, $auth_header, 0))[1])
599 18 0 if ($client_id and $client_secret)
612 9 42 if ($grant_type eq 'refresh_token') { }
7 35 elsif ($grant_type eq 'password') { }
12 23 elsif ($grant_type eq 'client_credentials') { }
647 9 3 unless $res
661 44 7 !ref($client) ? :