diff --git a/Changes b/Changes index db84e82..b500069 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,8 @@ -1.52 Mon Apr 6 22:45:17 2015 + +1.53 Not Released + - Removed fix_get_token hack + +1.52 2015-04-06 22:45:17 - Add oauth2->get_token() works in blocking mode (Alexander Karelas) 1.51 2015-03-18 17:38:19 diff --git a/lib/Mojolicious/Plugin/OAuth2.pm b/lib/Mojolicious/Plugin/OAuth2.pm index 02d967f..7d854fd 100644 --- a/lib/Mojolicious/Plugin/OAuth2.pm +++ b/lib/Mojolicious/Plugin/OAuth2.pm @@ -53,11 +53,6 @@ sub register { $self->providers($providers); - unless ($self->{fix_get_token} = $config->{fix_get_token}) { - deprecated - "\$c->oauth2->get_token(...) has changed api! Please set 'fix_get_token' in the config arguments to move forward. Sorry for the inconvenience."; - } - if ($providers->{mocked}{key}) { $self->_mock_interface($app); } @@ -222,9 +217,7 @@ sub _process_response_code { $data = Mojo::Parameters->new($tx->res->body)->to_hash; } - $err = $data ? '' : $err || 'Unknown error'; - - $c->$cb($err, $self->{fix_get_token} ? $data : $data->{access_token}); + $c->$cb($data ? '' : $err || 'Unknown error', $data); }, ); } @@ -316,6 +309,11 @@ L is installed. $ mojo version +=head2 Breaking changes + +Between 1.51 (2015-03-18) and 1.53 (2015-09-08) we decided to remove the back +compat hack for L, making it act I as documented. + =head2 References =over 4 diff --git a/t/Helper.pm b/t/Helper.pm index 1bd1cd4..086d9c6 100644 --- a/t/Helper.pm +++ b/t/Helper.pm @@ -9,8 +9,7 @@ sub make_app { $app->plugin( OAuth2 => { - fix_get_token => 1, - test => { + test => { authorize_url => '/oauth/authorize', token_url => '/oauth/token', key => 'fake_key', diff --git a/t/get_authorize_url.t b/t/get_authorize_url.t index f4ffdb0..a190150 100644 --- a/t/get_authorize_url.t +++ b/t/get_authorize_url.t @@ -5,7 +5,7 @@ use Test::More; my $authorize_args = {}; use Mojolicious::Lite; -plugin 'OAuth2' => {fix_get_token => 1, facebook => {key => 'KEY'}}; +plugin 'OAuth2' => {facebook => {key => 'KEY'}}; get '/test123', sub { $_[0]->render(text => $_[0]->get_authorize_url('facebook', $authorize_args)); }; my $t = Test::Mojo->new; diff --git a/t/mocked.t b/t/mocked.t index 2cc332e..1b39aea 100644 --- a/t/mocked.t +++ b/t/mocked.t @@ -5,7 +5,7 @@ use Test::More; { use Mojolicious::Lite; - plugin OAuth2 => {fix_get_token => 1, mocked => {key => '42'}}; + plugin OAuth2 => {mocked => {key => '42'}}; get '/test123' => sub { my $c = shift; diff --git a/t/mocked_blocking.t b/t/mocked_blocking.t index 752153c..88b2762 100644 --- a/t/mocked_blocking.t +++ b/t/mocked_blocking.t @@ -5,7 +5,7 @@ use Test::More; { use Mojolicious::Lite; - plugin OAuth2 => {fix_get_token => 1, mocked => {key => '42'}}; + plugin OAuth2 => {mocked => {key => '42'}}; get '/test123' => sub { my $c = shift; diff --git a/t/oauth2-auth_url.t b/t/oauth2-auth_url.t index 9a8b854..6d8aaac 100644 --- a/t/oauth2-auth_url.t +++ b/t/oauth2-auth_url.t @@ -5,7 +5,7 @@ use Test::More; my $authorize_args = {}; use Mojolicious::Lite; -plugin 'OAuth2' => {fix_get_token => 1, facebook => {key => 'KEY'}}; +plugin 'OAuth2' => {facebook => {key => 'KEY'}}; get '/test123', sub { $_[0]->render(text => $_[0]->oauth2->auth_url('facebook', $authorize_args)); }; my $t = Test::Mojo->new;