$cred = undef;
}
if ($cred) {
- $cred->check_netrc unless defined $cred->{password};
- $cred->fill($lei); # may prompt user here
+ my $p = $cred->{password} // $cred->check_netrc;
+ $cred->fill($lei) unless defined($p); # may prompt user here
$mic->User($mic_arg->{User} = $cred->{username});
$mic->Password($mic_arg->{Password} = $cred->{password});
} else { # AUTH=ANONYMOUS
}
$mic = undef;
}
- $cred->run($mic ? 'approve' : 'reject') if $cred;
+ $cred->run($mic ? 'approve' : 'reject') if $cred && $cred->{filled};
if ($err) {
$lei ? $lei->fail($err) : warn($err);
}
}, 'PublicInbox::GitCredential';
($u, $p) = split(/:/, $ui, 2);
($cred->{username}, $cred->{password}) = ($u, $p);
- $cred->check_netrc unless defined $p;
+ $p //= $cred->check_netrc;
}
my $common = $nn_args->{$sec} // {};
my $nn_arg = {
%$nn_arg = (%$nn_arg, %$sa) if $sa;
my $nn = nn_new($nn_arg, $nntp_opt, $uri);
if ($cred) {
- $cred->fill($lei); # may prompt user here
+ $cred->fill($lei) unless defined($p); # may prompt user here
if ($nn->authinfo($u, $p)) {
push @{$nntp_opt->{-postconn}}, [ 'authinfo', $u, $p ];
} else {
}
$self->{nn_arg}->{$sec} = $nn_arg;
- $cred->run($nn ? 'approve' : 'reject') if $cred;
+ $cred->run($nn ? 'approve' : 'reject') if $cred && $cred->{filled};
$nn;
}