-----Original Message-----
From: Graham TerMarsch <cgi-applicat...@howlingfrog.com>
To: cgiapp <cgiapp@lists.erlbaum.net>; Mark Stosberg <m...@summersault.com>
Cc: n1zero <n1z...@aol.com>
Sent: Thu, Jun 17, 2010 8:01 am
Subject: Re: [cgiapp] CAP::Authentication->redirect_after_login


On June 16, 2010, n1z...@aol.com wrote:
> I am using CA::Dispatch & CAP::Authentication in pretty much their
> out-the-box state. I have found that I get this to work only if I hack a
> line in CAP::Authentication, but I'd like to know why things don't work
> without the hack and what I should do to avoid it.

>     <Location /trial>
>         SetHandler perl-script
>         PerlHandler CGI::Application::Dispatch
>     </Location>
> so that the user hits /trial/mod3/page2 and this is dispatched to Mod3.pm
> in runmode page2. (This all works perfectly.)

> But this is where it goes wrong.  When the user hits <Sign In> the post
> goes to /trial, which doesn't exist (in this example app).  Looking at the
> page of the form reveals it has action="/trial". That comes from
> CAP::Authentication, "my $action = $query->url( -absolute => 1 );", which
> gives in my case '/trial'.

Hmmm... this sounds an awful lot like:
  https://rt.cpan.org/Ticket/Display.html?id=45019
where the "path_info" isn't properly set up if you're using URL rewriting via 
mod_rewrite, and as a result generated links thereafter aren't generated the 
way that you think they should be.
-- 
Graham TerMarsch
Howling Frog Internet Development, Inc.
-----End Original Message-----

Hi Graham, I'm not using rewriting, but it's possible using Dispatch is 
tickling a similar bug in CGI.
When the user hits /trial/mod3_submod0/ (which gives the very useful built-in 
env page of CA) I see

 1. DOCUMENT_ROOT => '/srv/trial/www/'
15. PATH_INFO => '/mod3_submod0/'
21. REQUEST_URI => '/trial/mod3_submod0/'
22. SCRIPT_FILENAME => '/srv/trial/www/trial'
23. SCRIPT_NAME => '/trial'

and separate logging shows that
_cgiapp->query->url(-absolute => 1) eq '/trial'
_cgiapp->query->self_url eq 'http://1.2.3.4:8182/trial/mod3_submod0/'

So it does look like a bug in CGI->url (using CGI v3.49 2010/02/05).

It looks like I can get the built-in login form to post to a sensible place if 
I hack it to set
$action = $self->_cgiapp->query->self_url or maybe something smarter that 
strips off the protocol & host.

On the other question, does anyone have a recommendation for where to implement 
redirecting a hit to /trial/mod3_submod0 instead to /trial/mod3_submod0/ 
(without using rewriting).
thanks,
Nic Sandfield

 

#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################

Reply via email to