Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

no use features, minor fixes

  • Loading branch information...
commit 70354c046068b2db4202fad7f8dc6aeed79bedbf 1 parent a030ad3
Zbigniew Lukasiak authored
View
4 Changes
@@ -1,4 +1,6 @@
Revision history for Plack::Middleware::Auth::Form.
-{{$NEXT}}
+0.001 2011-02-26
+{{$NEXT}}
+ No "use feature ':5.10'".
View
2  dist.ini
@@ -3,7 +3,7 @@ author = Zbigniew Lukasiak <zby@cpan.org>
license = Artistic_2_0
copyright_holder = Zbigniew Lukasiak <zby@cpan.org>
copyright_year = 2011
-version = 0.001
+version = 0.003
[@Basic]
[AutoPrereqs]
View
8 lib/Plack/Middleware/Auth/Form.pm
@@ -2,8 +2,6 @@ use strict;
use warnings;
package Plack::Middleware::Auth::Form;
-use feature ':5.10';
-
use parent qw/Plack::Middleware/;
use Plack::Util::Accessor qw( secure authenticator no_login_page after_logout );
use Plack::Request;
@@ -44,7 +42,7 @@ sub _login {
my($self, $env) = @_;
my $login_error;
if( $self->secure && $env->{'psgi.url_scheme'} ne 'https' ){
- my $server = $env->{X_FORWARDED_FOR} // $env->{X_HTTP_HOST} // $env->{SERVER_NAME};
+ my $server = $env->{X_FORWARDED_FOR} || $env->{X_HTTP_HOST} || $env->{SERVER_NAME};
my $secure_url = "https://$server" . $env->{PATH_INFO};
return [
301,
@@ -106,7 +104,7 @@ sub _render_form {
if( $params{login_error} ){
$out .= qq{<div class="error">$params{login_error}</div>};
}
- my $username = $params{username} // '';
+ my $username = defined $params{username} ? $params{username} : '';
$out .= <<END;
<form id="login_form" method="post" >
<fieldset class="main_fieldset">
@@ -136,7 +134,7 @@ sub _logout {
__END__
-# ABSTRACT: Form Based Authentication for Plack (think CatalystX::Simple)
+# ABSTRACT: Form Based Authentication for Plack (think CatalystX::LoginSimple)
=head1 SYNOPSIS
View
2  t/main.t
@@ -3,7 +3,7 @@ use warnings;
use Test::More;
use Test::WWW::Mechanize::PSGI;
-my $app = do 't/app.psgi';
+my $app = do 't/app.psgi' || warn $! ? "Cannot find 't/app.psgi: $!" : "Cannot compile 't/app.psgi': $@";
my $mech = Test::WWW::Mechanize::PSGI->new( app => $app );
$mech->get( '/some_page' );
Please sign in to comment.
Something went wrong with that request. Please try again.