Don't load password when password_type is 'none'
[catagits/Catalyst-Plugin-Authentication.git] / lib / Catalyst / Authentication / Credential / Password.pm
index 0ce16c7..a9d8da5 100644 (file)
@@ -59,12 +59,13 @@ sub check_password {
     if ($self->_config->{'password_type'} eq 'self_check') {
         return $user->check_password($authinfo->{$self->_config->{'password_field'}});
     } else {
+        return 1
+            if $self->_config->{'password_type'} eq 'none';
+
         my $password = $authinfo->{$self->_config->{'password_field'}};
         my $storedpassword = $user->get($self->_config->{'password_field'});
 
-        if ($self->_config->{'password_type'} eq 'none') {
-            return 1;
-        } elsif ($self->_config->{'password_type'} eq 'clear') {
+        if ($self->_config->{'password_type'} eq 'clear') {
             # FIXME - Should we warn in the $storedpassword undef case,
             #         as the user probably fluffed the config?
             return unless defined $storedpassword;