Skip to content

Commit

Permalink
only authenticate on pages we need it
Browse files Browse the repository at this point in the history
  • Loading branch information
haarg committed Nov 20, 2016
1 parent 41cefae commit bc2f0db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/MetaCPAN/Web/Controller/Account.pm
Expand Up @@ -13,6 +13,9 @@ sub auto : Private {
# this is for proxies
$c->res->header( Vary => 'Cookie' );

if ( my $token = $c->token ) {
$c->authenticate( { token => $token } );
}
unless ( $c->user_exists ) {
$c->forward('/forbidden');
}
Expand Down
3 changes: 0 additions & 3 deletions lib/MetaCPAN/Web/Controller/Root.pm
Expand Up @@ -24,9 +24,6 @@ MetaCPAN::Web::Controller::Root - Root Controller for MetaCPAN::Web

sub auto : Private {
my ( $self, $c ) = @_;
if ( my $token = $c->token ) {
$c->authenticate( { token => $token } );
}
Log::Log4perl::MDC->put( "ip", $c->req->address );
Log::Log4perl::MDC->put( "url", $c->req->uri . '' );
return 1;
Expand Down

0 comments on commit bc2f0db

Please sign in to comment.