Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions lib/MetaCPAN/Web/Controller/Account.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ BEGIN { extends 'MetaCPAN::Web::Controller' }
sub auto : Private {
my ( $self, $c ) = @_;

# Keep everything here as specific to the user
# this is for proxies
$c->res->header( Vary => 'Cookie' );
$c->cdn_never_cache(1);

if ( my $token = $c->token ) {
$c->authenticate( { token => $token } );
Expand Down
8 changes: 8 additions & 0 deletions lib/MetaCPAN/Web/Controller/Login.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ BEGIN { extends 'MetaCPAN::Web::Controller' }

sub index : Path : Args(0) {
my ( $self, $c ) = @_;

# Never cache at CDN
$c->cdn_never_cache(1);

if ( my $code = $c->req->parameters->{code} ) {
my $data = $c->model('API')->request(
'/oauth2/access_token',
Expand All @@ -29,6 +33,10 @@ sub index : Path : Args(0) {

sub openid : Local : Args(0) {
my ( $self, $c ) = @_;

# Never cache at CDN
$c->cdn_never_cache(1);

$c->stash( { template => 'account/openid-login.html' } );
}

Expand Down
5 changes: 3 additions & 2 deletions t/controller/account.t
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ test_psgi app, sub {
'GET /account/profile without token'
);
is( $res->code, 403, '... and the user cannot get in' );
is( $res->header('Vary'),
'Cookie', '... and the Vary header for proxies is there' );
is( $res->header('Cache-Control'),
'private',
'... and the private Cache-Control header for proxies is there' );
is( $authenticate_args, undef,
'... and we did not try to authenticate' );

Expand Down