Skip to content

Commit

Permalink
Add Auth::Digest to Dancer version, correct missing Auth::Digest in o…
Browse files Browse the repository at this point in the history
…thers.
  • Loading branch information
mateu committed Mar 7, 2011
1 parent da360b2 commit 753f7ee
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
3 changes: 2 additions & 1 deletion app/mojito.psgi
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ s/(<section\s+id="recent_area".*?>)<\/section>/$1${links}<\/section>/si;
builder {
enable "+Mojito::Middleware";
# enable "Auth::Basic", authenticator => \&Mojito::Auth::authen_cb;
enable "Auth::Digest",
enable_if { $_[0]->{PATH_INFO} !~ m/^\/(?:public|favicon.ico)/ }
"Auth::Digest",
realm => "Mojito",
secret => Mojito::Auth::_secret,
password_hashed => 1,
Expand Down
13 changes: 12 additions & 1 deletion app/mojito_dancer.psgi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env perl
use Dancer;
use Dancer::Plugin::Ajax;
use Plack::Builder;
use Mojito;
use Mojito::Auth;

Expand Down Expand Up @@ -74,4 +75,14 @@ get '/' => sub {
return $mojito->view_home_page;
};

dance;
builder {
enable "+Mojito::Middleware";
enable_if { $_[0]->{PATH_INFO} !~ m/^\/(?:public|favicon.ico)/ }
"Auth::Digest",
realm => "Mojito",
secret => Mojito::Auth::_secret,
password_hashed => 1,
authenticator => Mojito::Auth->new->digest_authen_cb;
dance;
};

11 changes: 6 additions & 5 deletions app/mojito_mojolicious.psgi
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@ get '/' => sub {
builder {
enable "+Mojito::Middleware";
# enable "Auth::Basic", authenticator => \&Mojito::Auth::authen_cb;
enable "Auth::Digest",
realm => "Mojito",
secret => Mojito::Auth::_secret,
password_hashed => 1,
authenticator => Mojito::Auth->new->digest_authen_cb;
enable_if { $_[0]->{PATH_INFO} !~ m/^\/(?:public|favicon.ico)/ }
"Auth::Digest",
realm => "Mojito",
secret => Mojito::Auth::_secret,
password_hashed => 1,
authenticator => Mojito::Auth->new->digest_authen_cb;
app->start;
};
11 changes: 6 additions & 5 deletions app/mojito_tatsumaki.psgi
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,12 @@ builder {
# enable 'Session';
# enable 'Auth::Form', authenticator => sub { 1 };

enable_if { $_[0]->{PATH_INFO} !~ m/^\/(?:public|favicon.ico)/ } "Auth::Digest",
realm => "Mojito",
secret => Mojito::Auth::_secret,
password_hashed => 1,
authenticator => Mojito::Auth->new->digest_authen_cb;
enable_if { $_[0]->{PATH_INFO} !~ m/^\/(?:public|favicon.ico)/ }
"Auth::Digest",
realm => "Mojito",
secret => Mojito::Auth::_secret,
password_hashed => 1,
authenticator => Mojito::Auth->new->digest_authen_cb;
$app;
};

Expand Down

0 comments on commit 753f7ee

Please sign in to comment.