[Catalyst] logging in - redirecting

Octavian Rasnita orasnita at gmail.com
Wed Dec 27 17:20:55 GMT 2006


From: "Juan Miguel Paredes" <juan.paredes at gmail.com>

> Hi, Octavian...
>
>> sub end : Private {
>> my ( $self, $c ) = @_;
>> $c->forward( $c->view('TT'));
>> }
>>
>> sub end : ActionClass('RenderView') {}
>>
>
> Doesn't it sound like a deja-vu somewhere? :)
>
> Also, maybe you would like something as:
>
> sub end : ActionClass('RenderView') {
>  $c->forward( $c->view('TT') ) unless $c->response->body; #note the unless
> }

Hi,

I have tried deleting the old sub end : Private class, and use the 
following:

sub end : ActionClass('RenderView') {
my ($self, $c) = @_;
$c->stash->{template} = "login.tt";
$c->forward($c->view('TT')) unless $c->response->body;
}

But nothing happends. It still gives a 404 Not Found error when the username 
and the password are correct.

If I don't use the following line in this subroutine
$c->stash->{template} = "login.tt";
then Catalyst prints an error message telling that the template file was not 
found.
It doesn't specify which file was not found, so I think that 
$c->stash->{template} specified in other subroutines is not taken into 
consideration.

Thank you.

Octavian




More information about the Catalyst mailing list