line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::Web::Auth::Site::Google; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1086
|
use Mojo::Base qw/Mojolicious::Plugin::Web::Auth::OAuth2/; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
has user_info => 1; |
6
|
|
|
|
|
|
|
has scope => 'email profile'; |
7
|
|
|
|
|
|
|
has authorize_url => 'https://accounts.google.com/o/oauth2/v2/auth?response_type=code'; |
8
|
|
|
|
|
|
|
has access_token_url => 'https://www.googleapis.com/oauth2/v4/token'; |
9
|
|
|
|
|
|
|
has user_info_url => 'https://www.googleapis.com/oauth2/v3/userinfo'; |
10
|
|
|
|
|
|
|
has access_type => 'offline'; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
0
|
0
|
|
sub moniker {'google'}; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub auth_uri { |
15
|
0
|
|
|
0
|
0
|
|
my ( $self, $c, $callback_uri ) = @_; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my $auth_uri = $self->SUPER::auth_uri($c, $callback_uri); |
18
|
0
|
|
|
|
|
|
my $url = Mojo::URL->new($auth_uri); |
19
|
0
|
0
|
|
|
|
|
$url->query->param( access_type => $self->access_type ) |
20
|
|
|
|
|
|
|
if (defined $self->access_type); |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
return $url->to_string; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |