[Catalyst] Transferring control via root/auto

Hernan Lopes hernanlopes at gmail.com
Tue Dec 7 16:13:32 GMT 2010


your redirect will make "auto" be executed again and redirecting again to
loginedit

On Tue, Dec 7, 2010 at 1:53 PM, Thompson <robt at matsch.com> wrote:

> Here is my problem,
>
> If a user logs in for the 1st time I want to force them to change their
> password.  I have a specific action in my Users controller to handle
> that.  What I'm having a problem with is (redirecting or forwarding or
> detaching - i've tried them all) from the root/auto function to my
> specific controller function.  I either get an internal server error or
> page isn't redirecting properly, depending what i use.  I've put my
> logic in the root/auto because regardless of the request changing their
> password is mandatory.
>
> Here is my current root/auto using redirect.
>
> sub auto : Private {
>          my ($self, $c) =3D @_;
>
>          if ($c->user_exists()&&  $c->check_any_user_role('User')
> &&  $c->user->changePassword  ) {
>
> $c->res->redirect($c->uri_for($c->controller('Users')->action_for('logine=
dit'),
>
> [$c->user->id] ));
>                 $c->detach();
>          }
>
>          return 1;
>      }
>
> Any help would be appreciated.
> Rob T
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20101207/f649a=
4db/attachment.htm


More information about the Catalyst mailing list