[Catalyst] c->user_exists causes runtime error.

leonard.a.jaffe at jpmchase.com leonard.a.jaffe at jpmchase.com
Wed Aug 2 18:51:31 CEST 2006


Cats:

The following code snippet:

unless ($c->user_exists) {
     my $standardid = $c->request->header('standardid') || 
$c->request->param('laj');
     unless ($c->login(uc($standardid))) {
        $c->error("Could not authenitcate".  ($standardid ?  ": 
$standardid" : 'UNKNOWN')  );
       return 0;
     }
  }

Generates the following error message: 

[error] Coldn't render template "undef error - Can't call method 
"from_session" on an undefined value at 
D:/Perl/site/lib/Catalyst\Plugin\Authentication.pm line 122.
[error] Caught exception in dtsis::Controller::Root->auto "Can't call 
method "from_session" on an undefined value at 
D:/Perl/site/lib/Catalyst\Plugin\Authentication.pm line 122.
[error] Coldn't render template "undef error - Can't call method 
"from_session" on an undefined value at 
D:/Perl/site/lib/Catalyst\Plugin\Authentication.pm line 122.

along with a debug screen.

What I don't understand, is why it blow up, because the same code snippet, 
with the outermost unless removed (so it calls login on every request) 
works just fine.

I'm using the most current set of authn/'session modules that have come 
through CPAN in last day or two, 
and I'm using Session::Store::DBIC, Authentication::Store::Minimal (due to 
a DBIC/session/freeze issue with
the user record, that I'd posted about already), and 
Session::State::Cookie. 

So, calling login each time is not a big deal for me in terms of resource 
usage, but obviously, I shouldn't really have to.

Any ideas?

Len.


-----------------------------------------
This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law.  If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED.  Although this transmission and
any attachments are believed to be free of any virus or other
defect that might affect any computer system into which it is
received and opened, it is the responsibility of the recipient to
ensure that it is virus free and no responsibility is accepted by
JPMorgan Chase & Co., its subsidiaries and affiliates, as
applicable, for any loss or damage arising in any way from its use.
If you received this transmission in error, please immediately
contact the sender and destroy the material in its entirety,
whether in electronic or hard copy format. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060802/4365d05a/attachment.htm 


More information about the Catalyst mailing list