Skip to content

Commit

Permalink
rename bearer to Bearer in returned token_type
Browse files Browse the repository at this point in the history
maps better for use in the Authorization header
  • Loading branch information
leejo committed Mar 17, 2015
1 parent 944d9e6 commit 370aa87
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Revision history for Mojolicious-Plugin-OAuth2-Server

0.10 2015-03-17
- change token_type to be Bearer rather than bearer as this maps better
for use in the Authorization header

0.09 2015-03-16
- fix refresh_token check to prevent it being used as an access token.
this adds an extra argument ($is_refresh_token) to the method that
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Authorization Server / Resource Server with Mojolicious

# VERSION

0.09
0.10

# SYNOPSIS

Expand Down
6 changes: 3 additions & 3 deletions lib/Mojolicious/Plugin/OAuth2/Server.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Authorization Server / Resource Server with Mojolicious
=head1 VERSION
0.09
0.10
=head1 SYNOPSIS
Expand Down Expand Up @@ -197,7 +197,7 @@ use MIME::Base64 qw/ encode_base64 decode_base64 /;
use Carp qw/ croak /;
use Crypt::PRNG qw/ random_string /;

our $VERSION = '0.09';
our $VERSION = '0.10';

my %CLIENTS;
my %AUTH_CODES;
Expand Down Expand Up @@ -406,7 +406,7 @@ sub _access_token_request {
$status = 200;
$json_response = {
access_token => $access_token,
token_type => 'bearer',
token_type => 'Bearer',
expires_in => $expires_in,
refresh_token => $refresh_token,
};
Expand Down
4 changes: 2 additions & 2 deletions t/030_expiry_config.t
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ cmp_deeply(
$t->tx->res->json,
{
access_token => re( '^.+$' ),
token_type => 'bearer',
token_type => 'Bearer',
expires_in => $TTL,
refresh_token => re( '^.+$' ),
},
Expand Down Expand Up @@ -130,7 +130,7 @@ cmp_deeply(
$t->tx->res->json,
{
access_token => re( '^.+$' ),
token_type => 'bearer',
token_type => 'Bearer',
expires_in => $TTL,
refresh_token => re( '^.+$' ),
},
Expand Down
4 changes: 2 additions & 2 deletions t/AllTests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ sub run {
$t->tx->res->json,
{
access_token => re( '^.+$' ),
token_type => 'bearer',
token_type => 'Bearer',
expires_in => '3600',
refresh_token => re( '^.+$' ),
},
Expand Down Expand Up @@ -178,7 +178,7 @@ sub run {
$t->tx->res->json,
{
access_token => re( '^.+$' ),
token_type => 'bearer',
token_type => 'Bearer',
expires_in => '3600',
refresh_token => re( '^.+$' ),
},
Expand Down

0 comments on commit 370aa87

Please sign in to comment.