In lib/Controller/Root.pm I'm using a standard pattern for automatically redirecting to a login controller if a user is not logged in and the user is not running either the registration or login controllers. lib/Controller/Root.pm
sub auto : Private { my ($self, $c) = @_; if ($c->controller eq $c->controller('Login') || ## The following test eventually starts failing ## while running the register controller: $c->controller eq $c->controller('Register') ) { return 1; } if (!$c->user_exists) { $c->response->redirect($c->uri_for('/login')); } ...

I am tweaking CSS/JS error handling and run the Register page repeatedly with deliberate input errors (empty input field etc). After a few cycles I modify the register controller or the appropriate template/form definition.

After a while the above test fails even though I know (from Catalyst debug output) the Register controller is being invoked and control passes to the Login controller.

Once this happens, it continues to happens until I restart Catalyst. Sometimes the same thing also happens to the login controller so Catalyst loops indefinitely redirecting to the login controller.

I am running Catalyst with the -r option and have been modifying the the register controller. Is it possible that this is introducing some instability?

I can't imagine that Catalyst would be so flaky in production so I can only assume that either the -r option introduces some instability (and I can live with that) or that I am somehow corrupting Catalyst by doing something dumb.

Any thoughts appreciated.

Using Catalyst 5.7014/ CGI::FormBuilder 3.0501 / Ubuntu 8.10 on a dedicated development VM. Running catalyst with the -r option


In reply to Catalyst controller comparison fails in Root controller auto() by smallvaluesof2

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.