From: Tomas Doran Date: Fri, 10 Oct 2008 10:07:21 +0000 (+0000) Subject: Warning fix X-Git-Tag: v1.007~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Authentication-Credential-HTTP.git;a=commitdiff_plain;h=e8cb49b7353a5a11ab7b93a3207b04ce62577fb6 Warning fix --- diff --git a/Changes b/Changes index c82adba..6a96e42 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ + - Fix warning when used with self_check => 1 + 1.006 2008-10-06 - Added username_field configuration option. I need this to play nice with Catalyst::Authentication::Store::Tangram. diff --git a/lib/Catalyst/Authentication/Credential/HTTP.pm b/lib/Catalyst/Authentication/Credential/HTTP.pm index 728581f..eacc14f 100644 --- a/lib/Catalyst/Authentication/Credential/HTTP.pm +++ b/lib/Catalyst/Authentication/Credential/HTTP.pm @@ -60,8 +60,11 @@ sub authenticate_basic { if ( my ( $username, $password ) = $headers->authorization_basic ) { my $user_obj = $realm->find_user( { $self->_config->{username_field} => $username }, $c); - if (ref($user_obj)) { - if ($self->check_password($user_obj, {$self->_config->{password_field} => $password})) { + if (ref($user_obj)) { + my $opts = {}; + $opts->{$self->_config->{password_field}} = $password + if $self->_config->{password_field}; + if ($self->check_password($user_obj, $opts)) { $c->set_authenticated($user_obj); return $user_obj; }