FAQ
Hi,

Upgrading Catalyst::Authentication::Store::DBIx::Class 0.1083 to 0.1200+, I get error:

" u2: , Can't call method "can" on an undefined value at /opt/netskills/apps/lib/perl5/site_perl/5.8.8/Catalyst/Authentication/Store/DBIx/Class/User.pm line 261.".


1. My yaml config:

authentication:
default_realm: 'users'
realms:
users:
credential:
class: 'Password'
password_type: 'self_check'
store:
class: N::E2::Core::Person'
user_model: 'E2::Person'


2. Catalyst::Authentication::Store:: N::E2::Core::Person

package Catalyst::Authentication::Store:: N::E2::Core::Person;
use strict;
use warnings;
use base qw/Catalyst::Authentication::Store::DBIx::Class/;
our $VERSION= "0.01";

sub new {
my ( $class, $config, $app ) = @_;
$config->{user_class} = 'E2::Person';
$config->{store_user_class} = 'Catalyst::Authentication::Store::N::E2::Core::Person::User';
$config->{role_relation} = 'authactions';
$config->{role_field} = 'name';
return $class->SUPER::new( $config, $app );
}
__PACKAGE__;
__END__


3. Catalyst::Authentication::Store:: N::E2::Core::Person::User

package Catalyst::Authentication::Store:: N::E2::Core::Person::User;
use strict;
use warnings;
use base qw/Catalyst::Authentication::Store::DBIx::Class::User/;
use base qw/Class::Accessor::Fast/;
use Data::Dump;

sub load {
my ($self, $authinfo, $c) = @_;
# Store supports finding by id, username.
if ( exists( $authinfo->{'id'} ) ) {
my $u = $self->user_model->find($authinfo->{'id'});
$self->_user( $u );
} elsif ( exists( $authinfo->{'username'} ) ) {
my $u;
eval { $u = $self->user_model->find({ username => $authinfo->{'username'}}); };
warn "u2: $u, $@ \n\n";
eval { $self->_user( $u ); };
warn "db2: $@ \n\n\n";
}
if ($self->get_object) {
return $self;
} else {
return undef;
}
}
1;
__END__


4. Logging in user in controller:

if ( $c->authenticate({ username => $uname, password => $pword, }) ) {
#
}


This is someone else's code I'm attempting to fix.
Can anyone spot why this is occurring and how I might be able to fix?

Regards,
Anthony

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedNov 11, '10 at 3:19p
activeNov 11, '10 at 3:19p
posts1
users1
websitecatalystframework.org
irc#catalyst

1 user in discussion

Anthony Gladdish: 1 post

People

Translate

site design / logo © 2021 Grokbase