your redirect will make "auto" be executed again and redirecting again to loginedit
On Tue, Dec 7, 2010 at 1:53 PM, Thompson <r...@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) = @_; > > if ($c->user_exists()&& $c->check_any_user_role('User') > && $c->user->changePassword ) { > > $c->res->redirect($c->uri_for($c->controller('Users')->action_for('loginedit'), > > [$c->user->id] )); > $c->detach(); > } > > return 1; > } > > Any help would be appreciated. > Rob T > > _______________________________________________ > List: Catalyst@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/ >
_______________________________________________ List: Catalyst@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/