+
+sub checkconfig () {
+ if ($config{cgi} && defined $config{cgiauthurl} &&
+ keys %{$IkiWiki::hooks{auth}} < 2) {
+ # There are no other auth hooks registered, so avoid
+ # the normal signin form, and jump right to httpauth.
+ require IkiWiki::CGI;
+ inject(name => "IkiWiki::cgi_signin", call => sub ($$) {
+ my $cgi=shift;
+ redir_cgiauthurl($cgi, $cgi->query_string());
+ });
+ }
+}