:OAuth;
use Mojo::Base 'Mojolicious::Plugin::Web::Auth::Base';
use Net::OAuth::Client;
use Mojo::JSON;
has 'request_token_url';
has is_v1a => 0;
has token_key => 'token';
has token_
or}->( $res->decoded_content )
unless ( $res->is_success );
push @args, Mojo::JSON::j( $res->decoded_content );
} else {
push @args, undef;
}
return $callback-
thorize';
has access_token_url => 'https://api.twitter.com/oauth/access_token';
has user_info_url => 'https://api.twitter.com/1.1/account/verify_credentials.json';
sub moniker { 'twitter' }
1;
=> 'code';
has access_token_url => 'https://oauth.yandex.ru/token';
has user_info_url => 'https://login.yandex.ru/info?format=json';
has authorize_header => 'OAuth';
sub moniker {'yandex'};
1;
d %s', $res->code, $res->default_message ) )
if $tx->error;
push @args, $res->json;
} else {
push @args, undef;
}
push @args, { %$dat }; # append rest of the r
->type(json => ['application/json', 'text/javascript']);
my $exts = $types->detect( $res->headers->content_type );
return ( scalar(@$exts) && $exts->[0] eq 'json' )
? $res->json