From 93645f5a6e047c0f36b970c21f09f55f69f938d7 Mon Sep 17 00:00:00 2001 From: Mara Sophie Grosch Date: Sun, 22 Oct 2023 18:48:17 +0200 Subject: [PATCH] Remove deprecated handler registration `http_basic_auth_set_check_handler sub {}` was deprecated since February 2019 (release 0.06), use `http_basic_auth_handler check_login => sub {}` instead. --- Changes | 1 + lib/Dancer2/Plugin/Auth/HTTP/Basic/DWIW.pm | 7 ------- t/02-plugin.t | 2 +- t/04-bad_stuff.t | 2 +- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Changes b/Changes index 46fa793..56c8362 100644 --- a/Changes +++ b/Changes @@ -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!) diff --git a/lib/Dancer2/Plugin/Auth/HTTP/Basic/DWIW.pm b/lib/Dancer2/Plugin/Auth/HTTP/Basic/DWIW.pm index cc31a7e..d458c93 100644 --- a/lib/Dancer2/Plugin/Auth/HTTP/Basic/DWIW.pm +++ b/lib/Dancer2/Plugin/Auth/HTTP/Basic/DWIW.pm @@ -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; diff --git a/t/02-plugin.t b/t/02-plugin.t index 07d409d..739d285 100644 --- a/t/02-plugin.t +++ b/t/02-plugin.t @@ -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'; diff --git a/t/04-bad_stuff.t b/t/04-bad_stuff.t index 33c177d..b310f13 100644 --- a/t/04-bad_stuff.t +++ b/t/04-bad_stuff.t @@ -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';