From: Joey Hess <joey@kitenet.net>
Date: Sat, 25 Dec 2010 19:08:22 +0000 (-0400)
Subject: use CGI->url to get current absolute cgi url for openid login process
X-Git-Tag: 3.20101231~36
X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/326c4d6af2fbcbdf9b1487d584f03e6f63e5597d

use CGI->url to get current absolute cgi url for openid login process
---

diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm
index 0cb8d6289..ce0990e40 100644
--- a/IkiWiki/Plugin/openid.pm
+++ b/IkiWiki/Plugin/openid.pm
@@ -148,7 +148,7 @@ sub validate ($$$;$) {
 	}
 
 	my $cgiurl=$config{openid_cgiurl};
-	$cgiurl=$config{cgiurl} if ! defined $cgiurl;
+	$cgiurl=$q->url if ! defined $cgiurl;
 
 	my $trust_root=$config{openid_realm};
 	$trust_root=$cgiurl if ! defined $trust_root;
@@ -249,7 +249,7 @@ sub getobj ($$) {
 	}
 	
 	my $cgiurl=$config{openid_cgiurl};
-	$cgiurl=$config{cgiurl} if ! defined $cgiurl;
+	$cgiurl=$q->url if ! defined $cgiurl;
 
 	return Net::OpenID::Consumer->new(
 		ua => $ua,
diff --git a/doc/todo/want_to_avoid_ikiwiki_using_http_or_https_in_urls_to_allow_serving_both.mdwn b/doc/todo/want_to_avoid_ikiwiki_using_http_or_https_in_urls_to_allow_serving_both.mdwn
index ba5259895..b069ee2bd 100644
--- a/doc/todo/want_to_avoid_ikiwiki_using_http_or_https_in_urls_to_allow_serving_both.mdwn
+++ b/doc/todo/want_to_avoid_ikiwiki_using_http_or_https_in_urls_to_allow_serving_both.mdwn
@@ -328,4 +328,6 @@ Update: I had to revert part of 296e5cb2fd3690e998b3824d54d317933c595873,
 since it broke openid logins. The openid object requires a complete,
 not a relative cgiurl. I'm not sure if my changing that back to using
 `$config{cgiurl}` will force users back to eg, the non-https version of a
-site when logging in via openid. smcv? --[[Joey]] 
+site when logging in via openid.
+
+> Ok, changed it to use `CGI->url` to get the current absolute cgi url. --[[Joey]]