Warning fix
Tomas Doran [Fri, 10 Oct 2008 10:07:21 +0000 (10:07 +0000)]
Changes
lib/Catalyst/Authentication/Credential/HTTP.pm

diff --git a/Changes b/Changes
index c82adba..6a96e42 100644 (file)
--- 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.
index 728581f..eacc14f 100644 (file)
@@ -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;
             }