Skip to content

Commit

Permalink
Clear token value when auth is disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
hexfusion committed Jun 17, 2017
1 parent 9963a74 commit c53c96d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ install:
script:
- perl Makefile.PL
- make
- prove -b -r -s -j$(test-jobs) $(test-files)
- make test
5 changes: 4 additions & 1 deletion lib/Net/Etcd.pm
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,10 @@ authentication process and stored until no longer valid or username is changed.
=cut

has auth_token => ( is => 'rwp' );
has auth_token => (
is => 'rwp',
clearer => 1,
);

=head1 PUBLIC METHODS
Expand Down
1 change: 1 addition & 0 deletions lib/Net/Etcd/Auth.pm
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ sub disable {
confess 'root name and password required for ' . __PACKAGE__ . '->disable'
unless ($self->password && $self->name);
$self->request;
$self->etcd->clear_auth_token;
return $self;
}

Expand Down

0 comments on commit c53c96d

Please sign in to comment.