line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use strict; |
3
|
1
|
|
|
1
|
|
818
|
use parent 'Dancer2::Plugin::Auth::OAuth::Provider'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
4
|
1
|
|
|
1
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
5
|
|
|
|
|
|
|
use HTTP::Request::Common; |
6
|
1
|
|
|
1
|
|
69
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
366
|
|
7
|
|
|
|
|
|
|
version => 2, |
8
|
|
|
|
|
|
|
urls => { |
9
|
3
|
|
|
3
|
0
|
68
|
authorize_url => 'https://www.facebook.com/dialog/oauth', |
10
|
|
|
|
|
|
|
access_token_url => 'https://graph.facebook.com/oauth/access_token', |
11
|
|
|
|
|
|
|
user_info => 'https://graph.facebook.com/me', |
12
|
|
|
|
|
|
|
}, |
13
|
|
|
|
|
|
|
query_params => { |
14
|
|
|
|
|
|
|
authorize => { |
15
|
|
|
|
|
|
|
response_type => 'code', |
16
|
|
|
|
|
|
|
scope => 'email,public_profile,user_friends', |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
} } |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my ($self, $session) = @_; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $fields = ''; |
24
|
1
|
|
|
1
|
0
|
3
|
if ( exists $self->provider_settings->{fields} ) { |
25
|
|
|
|
|
|
|
$fields = "&fields=".$self->provider_settings->{fields}; |
26
|
1
|
|
|
|
|
10
|
} |
27
|
1
|
50
|
|
|
|
4
|
|
28
|
0
|
|
|
|
|
0
|
my $session_data = $session->read('oauth'); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
my $resp = $self->{ua}->request( |
31
|
1
|
|
|
|
|
5
|
GET $self->provider_settings->{urls}{user_info}."?access_token=". |
32
|
|
|
|
|
|
|
$session_data->{facebook}{access_token}. |
33
|
|
|
|
|
|
|
$fields |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
|
|
28
|
if( $resp->is_success ) { |
37
|
|
|
|
|
|
|
my $user = $self->_stringify_json_booleans( |
38
|
|
|
|
|
|
|
JSON::MaybeXS::decode_json( $resp->content ) |
39
|
1
|
50
|
|
|
|
372
|
); |
40
|
1
|
|
|
|
|
15
|
$session_data->{facebook}{user_info} = $user; |
41
|
|
|
|
|
|
|
$session->write('oauth', $session_data); |
42
|
|
|
|
|
|
|
} |
43
|
1
|
|
|
|
|
3
|
|
44
|
1
|
|
|
|
|
11
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |