Small patch for additional debugging
Tomas Doran [Thu, 2 Apr 2009 15:19:10 +0000 (15:19 +0000)]
Changes
lib/Catalyst/Authentication/Credential/HTTP.pm

diff --git a/Changes b/Changes
index 0a1cf97..60b0904 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,12 +1,14 @@
+   - Add debug when a user is found, but passwords don't match (abraxxa)
+
 1.009  2009-01-04
-   - Remove use of _config accessor, which I'd stupidly cargo-culted. 
-     As we don't ever run in auth back-compat mode, we can store 
+   - Remove use of _config accessor, which I'd stupidly cargo-culted.
+     As we don't ever run in auth back-compat mode, we can store
      everything in instance data without worrying about conflicts.
      Note however - have to keep the accessor itself so that our
      parent class (which is still stupid and uses it) continues to work.
 
 1.008  2008-12-10
-  - Fix issue with the user not being authenticated into the correct 
+  - Fix issue with the user not being authenticated into the correct
     realm, by not calling $c->set_authenticated ourselves, but instead
     just returning the user object. Fix suggested by Bernhard Graf. (t0m)
     - Add test for this (t0m)
index ebc3c09..96eafe5 100644 (file)
@@ -71,11 +71,18 @@ sub authenticate_basic {
            my $user_obj = $realm->find_user( { $self->username_field => $username }, $c);
            if (ref($user_obj)) {
             my $opts = {};
-            $opts->{$self->password_field} = $password 
-                if $self->password_field;            
+            $opts->{$self->password_field} = $password
+                if $self->password_field;
             if ($self->check_password($user_obj, $opts)) {
                 return $user_obj;
             }
+            else {
+                $c->log->debug("Password mismatch!") if $c->debug;
+            }
+         }
+         else {
+             $c->log->debug("Unable to locate user matching user info provided")
+                if $c->debug;
         }
         else {
             $c->log->debug("Unable to locate user matching user info provided") if $c->debug;