Branch Coverage

blib/lib/Mojolicious/Plugin/OAuth2/Server.pm
Criterion Covered Total %
branch 76 90 84.4


line true false branch
169 0 21 if ($config->{'users'} and not $config->{'jwt_secret'})
239 32 68 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 25 42 unless _access_token_request_check_params($self, $grant_type, $username, $password, $auth_code, $uri)
425 3 32 $grant_type eq 'client_credentials' ? :
7 35 $grant_type eq 'password' ? :
434 22 20 if ($client) { }
20 0 elsif ($error) { }
436 0 22 ref $client ? :
438 22 0 $Grant->can('get_access_token_ttl') ? :
461 19 3 $grant_type ne 'password' ? :
2 20 $grant_type eq 'client_credentials' ? :
487 2 12 ref $scope eq 'HASH' ? :
14 8 !$old_refresh_token && $scope ? :
2 20 $grant_type eq 'client_credentials' ? :
502 1 19 if $error_description
505 0 0 $grant_type eq 'client_credentials' ? :
0 0 $grant_type eq 'password' ? :
527 7 60 if ($grant_type eq 'password') { }
10 50 elsif ($grant_type eq 'client_credentials') { }
18 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 7 3 unless ($client_id and $client_secret)
584 7 6 if (my $auth_header = $self->req->headers->header("Authorization"))
585 7 0 if (my($encoded_details) = (split(/Basic /, $auth_header, 0))[1])
601 9 33 if ($grant_type eq 'refresh_token') { }
7 26 elsif ($grant_type eq 'password') { }
3 23 elsif ($grant_type eq 'client_credentials') { }
636 1 2 unless $res
650 35 7 !ref($client) ? :