Skip to content

Commit

Permalink
Remove deprecated handler registration
Browse files Browse the repository at this point in the history
`http_basic_auth_set_check_handler sub {}` was deprecated since February
2019 (release 0.06), use `http_basic_auth_handler check_login => sub {}`
instead.
  • Loading branch information
Mara Sophie Grosch committed Oct 22, 2023
1 parent 6627d43 commit 93645f5
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Revision history for Dancer2-Plugin-Auth-HTTP-Basic-DWIW

0.09 2023-10-22
- fix for Dancer2 1.0.0: header keyword deprecated, replaced by response_header (thanks ANDK!)
- remove deprecated handler configuration (deprecated since 0.06, so Feb 2019)

0.0801 2020-09-30
- add repository URL to metacpan sidebar (thanks github @chorny!)
Expand Down
7 changes: 0 additions & 7 deletions lib/Dancer2/Plugin/Auth/HTTP/Basic/DWIW.pm
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@ register http_basic_auth_login => sub {
is_global => 0
};

register http_basic_auth_set_check_handler => sub {
my ($dsl, $handler) = @_;

warn 'This is deprecated! Please use http_basic_auth_handler check_login => sub {}';
$dsl->http_basic_auth_handler(check_login => $handler);
};

register http_basic_auth_handler => sub {
my ($dsl, $name, $handler) = @_;
$HANDLERS->{$name} = $handler;
Expand Down
2 changes: 1 addition & 1 deletion t/02-plugin.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use HTTP::Request::Common;
use Dancer2;
use Dancer2::Plugin::Auth::HTTP::Basic::DWIW;

http_basic_auth_set_check_handler sub {
http_basic_auth_handler check_login => sub {
my ( $user, $pass ) = @_;

return $user eq 'foo' && $pass eq 'bar';
Expand Down
2 changes: 1 addition & 1 deletion t/04-bad_stuff.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use HTTP::Request::Common;
use Dancer2;
use Dancer2::Plugin::Auth::HTTP::Basic::DWIW;

http_basic_auth_set_check_handler sub {
http_basic_auth_handler check_login => sub {
my ( $user, $pass ) = @_;
die 'foo';
return $user eq 'foo' && $pass eq 'bar';
Expand Down

0 comments on commit 93645f5

Please sign in to comment.