[Catalyst] exception handling?

Caroline Johnston johnston at biochemistry.ucl.ac.uk
Tue Nov 15 19:18:13 CET 2005


> Hmm. Against 5.5+, I'd suggest using
>
> $c->forward('/login/login')
>   unless ($c->session->{user} || $c->action eq '/login/login');
>

eeep:
Caught exception "Operation `eq': no method found,
        left argument in overloaded package Catalyst::Action,
        right argument has no overloaded magic

$c->action->name seems to work. Should it?

the /login match was a shortcut cos I've got login/login and
login/register and I need to allow public access to both. Better to name
the paths explicitly?

Do you think:

	unless ($c->session->{user} || grep {/$c->action->name/}
@{$c->config->{no_login}});

and myapp.yml:

#allow certain paths pages to be accessed with no user logged in:
no_login:
  - 'login/login'
  - 'login/register'

is overkill?

Cxx






More information about the Catalyst mailing list