<%once> use CGI::Auth::Flexible; sub do_redirect_mason ($$$$) { my ($c, $ar, $new_url, $cookie) = @_; $m->auto_send_headers(0); CGI::Auth::Flexible::do_redirect_cgi($c,$ar,$new_url,$cookie); } sub login_ok_self ($$) { my ($c, $ar) = @_; my $password = $c->param('password'); return $password eq 'sesame' ? ('self',undef) : (undef,'wrong'); } my $ar = CGI::Auth::Flexible->new_verifier( dir => "$ENV{'NJAWAYMSG'}/data", # do_redirect => \&do_redirect_mason, handle_divert => sub { $m->auto_send_headers(0); return 0; }, # print => sub { my ($c,$ar,@t) = @_; $m->print(@t); }, encrypted_only => 0, username_param_names => [], login_ok => \&login_ok_self, ); <%perl> my $cgi = $m->cgi_object(); print STDERR ">".$cgi->url()."<\n"; my $ar = $ar->new_request($cgi); if ($ar->check_ok()) { $m->call_next();
<% $ar->secret_hidden_html() %>
<%perl> }