From: Tomas Doran Date: Thu, 2 Apr 2009 15:19:10 +0000 (+0000) Subject: Small patch for additional debugging X-Git-Tag: v1.010~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Authentication-Credential-HTTP.git;a=commitdiff_plain;h=8f5d966b540636b91cf6aaf936c5cce97330037e Small patch for additional debugging --- diff --git a/Changes b/Changes index 0a1cf97..60b0904 100644 --- 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) diff --git a/lib/Catalyst/Authentication/Credential/HTTP.pm b/lib/Catalyst/Authentication/Credential/HTTP.pm index ebc3c09..96eafe5 100644 --- a/lib/Catalyst/Authentication/Credential/HTTP.pm +++ b/lib/Catalyst/Authentication/Credential/HTTP.pm @@ -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;