my $app = sub { .. }
sub authenticator {
my ($ausername, $apassword, $env) = @_;
print STDERR "\nAuthenticating $ausername\n";
return $ausername eq 'admin' && $apassword eq 'secret';
}
my $server = builder {
enable "Auth::Basic", authenticator => \&authenticator;
$app;
};
# Running the PSGI application
my $runner = Plack::Runner->new;
$runner->parse_options('-s', 'Twiggy');
$runner->run($server);
When the username and password are correct I receive:
Response should be array ref or code ref: at /app/local/lib/perl5/Plack/Middleware/Lint.pm line 120 Plack::Middleware::Lint::validate_res('Plack::Middleware::Lint=HASH(0x55b14e4399a8)', '') called at /app/local/lib/perl5/Plack/Middleware/Lint.pm line 40
I have http auth on two paths, tried to insert debug to sort what is going on but seems when the authenticate is successful Plack::Middleware::Lint::validate_res bails.
When the username and password are correct I receive:
Response should be array ref or code ref: at /app/local/lib/perl5/Plack/Middleware/Lint.pm line 120 Plack::Middleware::Lint::validate_res('Plack::Middleware::Lint=HASH(0x55b14e4399a8)', '') called at /app/local/lib/perl5/Plack/Middleware/Lint.pm line 40
I have http auth on two paths, tried to insert debug to sort what is going on but seems when the authenticate is successful Plack::Middleware::Lint::validate_res bails.
Any help would be appreciated.