http://www.perlmonks.org?node_id=1148590

pcouderc has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks, I am trying to authenticate and I success :
sub startup { my $self = shift; my $r = $self->routes; $r->get('/:layout')->to('login#nolog'); $r->get('/:layout/logout')->to('login#logout'); my $auth = $r->under( sub { return defined($self->session('userid' +)) } ); $auth->get('/:layout/menu')->to('login#menu'); $r->any('/:layout/:dummy')->to('login#nolog');}
I authenticate in Login.pm sub nolog, I define userid and I redirect to "upsmichel/menu", I expect "login/menu.html.ep" to be rendered but instead I am routed to a callback ?
why ? What do I miss ?
Thanks
PC
Wed Nov 25 10:03:48 2015] [debug] GET "/upsmichel/nolog". [Wed Nov 25 10:03:48 2015] [debug] Routing to controller "Myapp::Contr +oller::Login" and action "nolog". [Wed Nov 25 10:03:48 2015] [debug] Rendering cached template "login/no +log.html.ep". [Wed Nov 25 10:03:48 2015] [debug] Rendering cached template "layouts/ +upsmichel.html.ep". [Wed Nov 25 10:03:48 2015] [debug] 200 OK (0.061906s, 16.154/s). [Wed Nov 25 10:04:02 2015] [debug] POST "/upsmichel/nolog". [Wed Nov 25 10:04:02 2015] [debug] Routing to controller "Myapp::Contr +oller::Login" and action "nolog". [Wed Nov 25 10:04:02 2015] [debug] 302 Found (0.031328s, 31.920/s). [Wed Nov 25 10:04:02 2015] [debug] GET "/upsmichel/menu". [Wed Nov 25 10:04:02 2015] [debug] Routing to a callback. [Wed Nov 25 10:04:02 2015] [debug] Nothing has been rendered, expectin +g delayed response.