<br><br><div class="gmail_quote">On Wed, Sep 30, 2009 at 7:30 AM, Derek Wueppelmann <span dir="ltr"><<a href="mailto:dwueppel@gmail.com">dwueppel@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'm actually doing forwards to my login page right now. So that when a<br>
user logs in they can still see the page they were originally trying to<br>
view. I capture the URL they were attempting to view in the login<br>
process.<br></blockquote><div><br>And then redirect back to that original page after login? <br></div><div><br>I pass that data via the cache or session. <br></div><div><br>$c->cache->set( $key, { <br> orig_url => $url,<br>
message => 'Auhorization is required',<br> });<br><br>$c->res->redirect( $c->uri_for( '/login', { info => $key } ) );<br><br><br>Catalyst docs show an example using auto. BTW - shouldn't the redirect be an absolute-URI?<br>
<br> sub auto : Private {<br> my ( $self, $c ) = @_;<br> if ( !$c->user_exists ) { # Catalyst::Plugin::Authentication<br> $c->res->redirect( '/login' ); # require login<br>
return 0; # abort request and go immediately to end()<br> }<br> return 1; # success; carry on to next action<br> }<br><br>RFC3986 has:<br>absolute-URI = scheme ":" hier-part [ "?" query ]<br>
<br>And 2616:<br> Location = "Location" ":" absoluteURI<br><br><br></div></div>-- <br>Bill Moseley<br><a href="mailto:moseley@hank.org">moseley@hank.org</a><br>