Subject: | Ability to pass query string in return_to URL |
I have a page:
http://domain.ru/openid_form?back=/page123
And I have no way to return to /page123 after successfull authentication.
Subject: | url.patch |
Index: lib/Catalyst/Authentication/Credential/OpenID.pm
===================================================================
--- lib/Catalyst/Authentication/Credential/OpenID.pm (revision 12473)
+++ lib/Catalyst/Authentication/Credential/OpenID.pm (working copy)
@@ -84,7 +84,10 @@
if ( $claimed_uri )
{
- my $current = $c->uri_for($c->req->uri->path); # clear query/fragment...
+ my $current = URI->new($authinfo->{current_url} || $c->req->uri->path); # clear query/fragment...
+ my $trust_root = URI->new( $current );
+ $trust_root->query('');
+ $trust_root->fragment('');
my $identity = $csr->claimed_identity($claimed_uri);
unless ( $identity )
@@ -102,10 +105,10 @@
$identity->set_extension_args(@extensions)
if @extensions;
-
+ $current->query_param( 'openid-check' => 1 );
my $check_url = $identity->check_url(
- return_to => $current . '?openid-check=1',
- trust_root => $current,
+ return_to => $current,
+ trust_root => $trust_root,
delayed_return => 1,
);
$c->res->redirect($check_url);