The presence of an authtoken ("ANONYMOUS") in the editor can be
misleading at higher levels of the code, since it implies a
presumably functional authtoken has been provided somewhow.
Apply ANONYMOUS only as needed to API calls instead.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
sub authtoken {
my( $self, $auth ) = @_;
$self->{authtoken} = $auth if $auth;
- return 'ANONYMOUS' if ($self->personality eq 'open-ils.pcrud' and !defined($self->{authtoken}));
return $self->{authtoken};
}
my $obj;
my $err = '';
- # In pcrud mode, sub authtoken returns 'ANONYMOUS' if one is not yet set
- unshift(@arg, $self->authtoken) if ($self->personality eq 'open-ils.pcrud');
+ # in PCRUD mode, if no authtoken is set, fall back to anonymous.
+ unshift(@arg, ($self->authtoken || 'ANONYMOUS'))
+ if ($self->personality eq 'open-ils.pcrud');
try {
$obj = $self->request($method, @arg);