2 use CGI::Auth::Flexible;
4 sub do_redirect_mason ($$$$) {
5 my ($c, $ar, $new_url, $cookie) = @_;
6 $m->auto_send_headers(0);
7 CGI::Auth::Flexible::do_redirect_cgi($c,$ar,$new_url,$cookie);
10 sub login_ok_self ($$) {
12 my $password = $c->param('password');
13 return $password eq 'sesame' ? ('self',undef) : (undef,'wrong');
16 our $verifier = CGI::Auth::Flexible->new_verifier(
17 dir => "$ENV{'NJAWAYMSG'}/data",
18 # do_redirect => \&do_redirect_mason,
19 handle_divert => sub { $m->auto_send_headers(0); return 0; },
20 # print => sub { my ($c,$ar,@t) = @_; $m->print(@t); },
22 username_param_names => [],
23 login_ok => \&login_ok_self,
27 our $cgi = $m->cgi_object();
28 our $ar = $verifier->new_request($cgi);
30 % if ($ar->check_ok()) {
33 <form method="POST" action="<% $ENV{'URL'} %>">
34 <% $ar->secret_hidden_html() %>
35 <input type="submit" name="caf_logout" value="Logout">