X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAuthentication%2FCredential%2FHTTP.pm;h=b2234b5a4bb31127a44ad029ea87cf72b67da09c;hb=60dd48a6bea236e5ceccb78c37b12f788c30129d;hp=ebc3c09d0c83eaae357621beb48c401d3e1b95f3;hpb=afe44be85845869628fe2917a5068d8e2b46434e;p=catagits%2FCatalyst-Authentication-Credential-HTTP.git diff --git a/lib/Catalyst/Authentication/Credential/HTTP.pm b/lib/Catalyst/Authentication/Credential/HTTP.pm index ebc3c09..b2234b5 100644 --- a/lib/Catalyst/Authentication/Credential/HTTP.pm +++ b/lib/Catalyst/Authentication/Credential/HTTP.pm @@ -20,14 +20,14 @@ __PACKAGE__->mk_accessors(qw/ use_uri_for /); -our $VERSION = '1.009'; +our $VERSION = '1.010'; sub new { my ($class, $config, $app, $realm) = @_; $config->{username_field} ||= 'username'; # _config is shity back-compat with our base class. - my $self = { %$config, _config => $config, _debug => $app->debug }; + my $self = { %$config, _config => $config, _debug => $app->debug ? 1 : 0 }; bless $self, $class; $self->realm($realm); @@ -71,14 +71,19 @@ 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("Unable to locate user matching user info provided") if $c->debug; + else { + $c->log->debug("Password mismatch!") if $c->debug; + return; + } + } + else { + $c->log->debug("Unable to locate user matching user info provided") + if $c->debug; return; } } @@ -630,6 +635,8 @@ Patches contributed by: =item Peter Corlett +=item Devin Austin (dhoss) C + =back =head1 SEE ALSO