projects
/
plack-middleware-auth-complex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f8d502f
)
Call init at first request to allow --preload-app
author
Marius Gavrilescu
<marius@ieval.ro>
Mon, 2 Mar 2015 14:05:33 +0000
(16:05 +0200)
committer
Marius Gavrilescu
<marius@ieval.ro>
Mon, 2 Mar 2015 14:05:33 +0000
(16:05 +0200)
lib/Plack/Middleware/Auth/Complex.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Plack/Middleware/Auth/Complex.pm
b/lib/Plack/Middleware/Auth/Complex.pm
index 758e0c24e4fc1361f699cc515117ed6a7e0c9717..ac70da693554a5aec710f194b3e386ba93fcf874 100644
(file)
--- a/
lib/Plack/Middleware/Auth/Complex.pm
+++ b/
lib/Plack/Middleware/Auth/Complex.pm
@@
-43,7
+43,6
@@
sub new {
my %self = $class->default_opts;
%self = (%self, %$opts);
my $self = bless \%self, $class;
my %self = $class->default_opts;
%self = (%self, %$opts);
my $self = bless \%self, $class;
- $self->init;
$self
}
$self
}
@@
-232,6
+231,12
@@
sub call_reset {
sub call {
my ($self, $env) = @_;
sub call {
my ($self, $env) = @_;
+
+ unless ($self->{init_done}) {
+ $self->init;
+ $self->{init_done} = 1;
+ }
+
my $auth = $env->{HTTP_AUTHORIZATION};
if ($auth && $auth =~ /^Basic (.*)$/i) {
my ($user, $pass) = split /:/, decode_base64($1), 2;
my $auth = $env->{HTTP_AUTHORIZATION};
if ($auth && $auth =~ /^Basic (.*)$/i) {
my ($user, $pass) = split /:/, decode_base64($1), 2;
@@
-420,7
+425,7
@@
Creates a new AuthComplex object.
=item B<init>
=item B<init>
-Called
at the end of the constructor
. The default implementation
+Called
when the first request is received
. The default implementation
connects to the database, calls C<post_connect_cb> and prepares the
SQL statements.
connects to the database, calls C<post_connect_cb> and prepares the
SQL statements.
This page took
0.011389 seconds
and
4
git commands to generate.