line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
69273
|
use strict; |
|
1
|
|
|
|
|
12
|
|
|
1
|
|
|
|
|
30
|
|
2
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
71
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Mojolicious::Plugin::Web::Auth::Site::Strava; |
5
|
|
|
|
|
|
|
our $VERSION = '0.000001'; |
6
|
1
|
|
|
1
|
|
484
|
use Mojo::Base qw/Mojolicious::Plugin::Web::Auth::OAuth2/; |
|
1
|
|
|
|
|
141532
|
|
|
1
|
|
|
|
|
7
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has access_token_url => 'https://www.strava.com/oauth/token'; |
9
|
|
|
|
|
|
|
has authorize_url => 'https://www.strava.com/oauth/authorize'; |
10
|
|
|
|
|
|
|
has response_type => 'code'; |
11
|
|
|
|
|
|
|
has scope => 'public'; |
12
|
|
|
|
|
|
|
has user_info => 1; |
13
|
|
|
|
|
|
|
has user_info_url => 'https://www.strava.com/api/v3/athlete'; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
0
|
0
|
|
sub moniker { 'strava' } |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
1; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=pod |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=encoding UTF-8 |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 NAME |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Mojolicious::Plugin::Web::Auth::Site::Strava - Strava OAuth Plugin for Mojolicious::Plugin::Web::Auth |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 VERSION |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
version 0.000001 |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 SYNOPSIS |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
my $client_id = '9999'; |
34
|
|
|
|
|
|
|
my $client_secret = 'seekrit'; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# Mojolicious |
37
|
|
|
|
|
|
|
$self->plugin( |
38
|
|
|
|
|
|
|
'Web::Auth', |
39
|
|
|
|
|
|
|
module => 'Strava', |
40
|
|
|
|
|
|
|
key => $client_id, |
41
|
|
|
|
|
|
|
secret => $client_secret, |
42
|
|
|
|
|
|
|
scope => 'view_private,write', |
43
|
|
|
|
|
|
|
on_finished => sub { |
44
|
|
|
|
|
|
|
my ( $c, $access_token, $access_secret ) = @_; |
45
|
|
|
|
|
|
|
...; |
46
|
|
|
|
|
|
|
}, |
47
|
|
|
|
|
|
|
); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# Mojolicious::Lite |
50
|
|
|
|
|
|
|
plugin 'Web::Auth', |
51
|
|
|
|
|
|
|
module => 'Strava', |
52
|
|
|
|
|
|
|
key => $client_id, |
53
|
|
|
|
|
|
|
secret => $client_secret, |
54
|
|
|
|
|
|
|
scope => 'view_private,write', |
55
|
|
|
|
|
|
|
on_finished => sub { |
56
|
|
|
|
|
|
|
my ( $c, $access_token, $access_secret ) = @_; |
57
|
|
|
|
|
|
|
...; |
58
|
|
|
|
|
|
|
}; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 DESCRIPTION |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
This module adds L |
63
|
|
|
|
|
|
|
support to L. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 AUTHOR |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Olaf Alders |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This software is copyright (c) 2018 by Olaf Alders. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
74
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
__END__ |