[Catalyst] problem with Authentication::CDBI
Srinivasa Mullangi
mullangi at rocketmail.com
Wed Jun 1 21:19:14 CEST 2005
Hi,
I am trying to implement 'Authentication with Catalyst::Plugin::Authentication::CDBI' example from the cook book.
Here is my config and code
authentication => { user_class => 'User',
user_field => 'email',
password_field => 'password',
role_class => 'Roles',
user_role_class => 'UserRoles',
user_role_user_field => 'user_id',
user_role_role_field => 'role_id',
},
sub begin : Private {
my ( $self, $c ) = @_;
unless ($c->req->{user}) {
$c->req->action(undef);
$c->forward('/login');
}
}
my $loginprofile = {
required => [qw(username password)],
};
sub login : Local {
my ($self, $c) = @_;
$c->stash->{template} = 'template/login.tt';
if($c->req->params->{submit}) {
my $results = Data::FormValidator->check($c->req->params, $loginprofile);
if($results->has_missing() || $results->has_invalid()) {
$c->stash->{error} = 'Error in the submitted data';
$c->stash->{results} = $results;
return;
}
$c->session_login($c->req->params->{username}, $c->req->params->{password});
if ($c->req->{user}) {
$c->forward('/');
}
}
}
I created an user with email: 'mullangi at rocketmail.com' and password 'abcde'.
I am getting the following error from the method $c->session_login(...)
[Wed Jun 1 10:45:27 2005] [catalyst] [error] Caught exception "Can't locate object method "log" via package "mullangi at rocketmail.com" (perhaps you forgot to load "mullangi at rocketmail.com"?) at /var/www/BettyMills-Admin/script/../lib/BettyMills/Admin.pm line 54."
Please advise on what is going wrong and how to fix.
Thanks
Srini
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20050601/d9e49aa8/attachment.html
More information about the Catalyst
mailing list