summaryrefslogtreecommitdiff
path: root/lib/MooseX/Net/API/Role/Authentication.pm
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-06-29 11:33:54 +0200
committerfranck cuny <franck@lumberjaph.net>2010-06-29 11:33:54 +0200
commit0909dd01e6369a63f84520bad36b4eb4ff19a448 (patch)
tree7ed7b99d4a3983e741f3aa134bc194e217be3ee1 /lib/MooseX/Net/API/Role/Authentication.pm
parentanother fix for path (diff)
downloadnet-http-api-0909dd01e6369a63f84520bad36b4eb4ff19a448.tar.gz
check if auth_method is declared
Diffstat (limited to '')
-rw-r--r--lib/MooseX/Net/API/Role/Authentication.pm14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/MooseX/Net/API/Role/Authentication.pm b/lib/MooseX/Net/API/Role/Authentication.pm
index 7859154..06b7e69 100644
--- a/lib/MooseX/Net/API/Role/Authentication.pm
+++ b/lib/MooseX/Net/API/Role/Authentication.pm
@@ -5,14 +5,14 @@ package MooseX::Net::API::Role::Authentication;
use Moose::Role;
has api_username => (
- is => 'rw',
- isa => 'Str',
+ is => 'rw',
+ isa => 'Str',
predicate => 'has_api_username',
);
has api_password => (
- is => 'rw',
- isa => 'Str',
+ is => 'rw',
+ isa => 'Str',
predicate => 'has_api_password',
);
@@ -26,7 +26,9 @@ after BUILDALL => sub {
$self->$_($value) if $value && !$self->$predicate;
}
- if (my $has_auth = $self->meta->get_api_option('authentication')) {
+ if ( $self->meta->get_api_option('authentication')
+ || $self->meta->get_api_option('authentication_method'))
+ {
my $auth_method = $self->meta->get_api_option('authentication_method');
if ($auth_method) {
$self->api_useragent->add_handler(
@@ -61,3 +63,5 @@ after BUILDALL => sub {
=item B<api_username>
=back
+64: hit eof while in pod documentation (no =cut seen)
+ this can cause trouble with some pod utilities