Skip Menu |

This queue is for tickets about the Catalyst-Plugin-Authentication CPAN distribution.

Report information
The Basics
Id: 33605
Status: rejected
Priority: 0/
Queue: Catalyst-Plugin-Authentication

People
Owner: Nobody in particular
Requestors: domm [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.10006
Fixed in: (no value)



Subject: $c->user not working if there is no user
Hi! I'm currently not entirely sure if the problem lies within C:P:A, but it seems so... When I'm calling (in a template) c.user, catalyst dies with Can't call method "auth_realms" on an undefined value at /opt/perl5.10/lib/site_perl/5.10.0/Catalyst/Plugin/Authentication.pm line 166 It seems that 164: $c->_user( my $user = $realm->from_session( $c, $frozen_user ) ); doesn't set $user, so the following call 166: $user->auth_realm($realmname); fails. adding 165: return unless $user; fixes the problem any other ideas?
Sorry, I was just stupid. Using c.user_exists fixes my problem On Di. 26. Feb. 2008, 17:53:36, DOMM wrote: Show quoted text
> Hi! > > I'm currently not entirely sure if the problem lies within C:P:A, but it > seems so... > > When I'm calling (in a template) c.user, catalyst dies with > Can't call method "auth_realms" on an undefined value at > /opt/perl5.10/lib/site_perl/5.10.0/Catalyst/Plugin/Authentication.pm > line 166 > > It seems that > 164: $c->_user( my $user = $realm->from_session( $c, $frozen_user ) ); > doesn't set $user, so the following call > 166: $user->auth_realm($realmname); > fails. > > > adding > 165: return unless $user; > fixes the problem > > any other ideas?