Skip to content

Commit

Permalink
don't duplicate auth in favorite controller
Browse files Browse the repository at this point in the history
The account controller already does the authorization.
  • Loading branch information
haarg committed Jan 5, 2018
1 parent ca834f6 commit 248aa57
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions lib/MetaCPAN/Web/Controller/Account/Favorite.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@ package MetaCPAN::Web::Controller::Account::Favorite;
use Moose;
BEGIN { extends 'MetaCPAN::Web::Controller' }

sub auto : Private {
my ( $self, $c ) = @_;

if ( my $token = $c->token ) {
$c->authenticate( { token => $token } );
}
unless ( $c->user_exists ) {
$c->forward('/forbidden');
}
return $c->user_exists;
}

sub add : Local : Args(0) {
my ( $self, $c ) = @_;
$c->detach('/forbidden') unless ( $c->req->method eq 'POST' );
Expand Down

0 comments on commit 248aa57

Please sign in to comment.