[Catalyst] stuck on tutorial's suggested variation

Michael Higgins linux at evolone.org
Tue Dec 4 19:04:53 GMT 2007


On Tue, 4 Dec 2007 11:05:31 -0500
Jason Kohles <email at jasonkohles.com> wrote:

> On Dec 4, 2007, at 10:22 AM, Michael Higgins wrote:

[8<]

> > what should $c->login look like if the "login" sub is part of
> > Controller/User?
> >
> $c->login and your login method are not the same method, $c->login
> is inherited from
> Catalyst::Plugin::Authentication::Credential::Password.

Thanks for that. $c->login and $c->redirect->uri_for('login') are very
different, then.

[8< redirecting error]

> This suggests that your redirection to logging in is being triggered  
> every time, rather than just when necessary.

Yep. It never rendered the login page and just looped.

> you don't have a controller named login.  What it seems you really  
> want here is:
> 
> if ( $c->controller eq $c->controller( 'User' ) ) {

Yes. Exactly right. Much better, that.

[8<]

> >
> Probably something along these lines:
> 
[8<]

Excellent, thanks!

Now I'm back on track... and things even are beginning to make some
sense!

Cheers,

-- 
 |\  /|        |   |          ~ ~  
 | \/ |        |---|          `|` ?
 |    |ichael  |   |iggins    \^ /
 michael.higgins[at]evolone[dot]org



More information about the Catalyst mailing list