[Catalyst] Newbie question - $c->login is missing

Jonathan Rockway jon at jrock.us
Tue Dec 4 17:41:18 GMT 2007


On Wed, 2007-12-05 at 01:31 +0800, Martin Ellison wrote:
> I have tried doing 
> 
>             if ($c->authenticate( { username => $username,
>                                 password => $password })) {
>            # if ($c->login($username, $password)) {
> (ie using authenticate instead on login) but then I get
> Use of uninitialized value in string eq
> at /usr/lib/perl5/site_perl/5.8.8/Catalyst/Authentication/Credential/Password.pm line 84.
> I'm not sure at all how that happens.

What are $username and $password set to?

> 
> Jason: Catalyst::Plugin::Authentication::Credential::Password says it
> is a compatibility shim for old code (see
> http://search.cpan.org/~jayk/Catalyst-Plugin-Authentication-0.10003/lib/Catalyst/Plugin/Authentication/Credential/Password.pm); then it refers us to Catalyst::Authentication::Credential::Password which advises using authenticate. 
> 
> But anyway authenticate does not appear to do all the login, as I
> thought login was also suppose to register the user with the session
> (and what else?)

Catalyst::Authentication::Credential::Password::authenticate doesn't do
that, but that's not the method that $c->authenticate calls.
$c->authenticate does the same thing that $c->login does.  (Actually
$c->login doesn't *have* to do anything; it was all very ad-hoc.  The
new authentication separates the various concerns and ensures that
Credentials only verify credentials.)

Regards,
Jonathan Rockway

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20071204/d7ec7e28/attachment.pgp


More information about the Catalyst mailing list