1 package Catalyst::Plugin::Authentication::Credential::Wrapper;
7 my ($myclass, $hash, $app) = @_;
10 if (!exists($hash->{'class'})) {
11 Carp::croak "Couldn't setup a wrapped Credential, no module specified";
14 my $wrappedclass = $hash->{'class'};
15 my $authroutine = $hash->{'authroutine'} ||= 'authenticate';
16 $data->{authroutine} = $wrappedclass->can($authroutine);
18 if (!$data->{'authroutine'}) {
19 Carp::croak "Couldn't set up a wrapped Credential, auth sub: $authroutine was not found";
22 bless $data, $myclass;
26 my ($self, $c, $store, $authinfo) = @_;
28 return $self->{'authroutine'}->($c, $store, $authinfo);