Skip to content

Commit

Permalink
Render empty layout for logged out home page
Browse files Browse the repository at this point in the history
Makes e2e tests happy, should eventually be replaced with some more systematic approach
to how to handle logged-out pages and redirects to login page.
  • Loading branch information
jsnajdr committed Nov 2, 2018
1 parent f8fc160 commit e5b64d2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions client/boot/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { getSections } from 'sections-helper';
import { checkFormHandler } from 'lib/protect-form';
import notices from 'notices';
import authController from 'auth/controller';
import { makeLayout, render as clientRender } from 'controller';

const debug = debugFactory( 'calypso' );

Expand Down Expand Up @@ -102,9 +103,10 @@ const loggedOutMiddleware = currentUser => {
}
} );
} else if ( config.isEnabled( 'devdocs/redirect-loggedout-homepage' ) ) {
page( '/', () => {
page.redirect( '/devdocs/start' );
} );
page( '/', '/devdocs/start' );
} else {
// render an empty layout with masterbar links for logged-out home page
page( '/', makeLayout, clientRender );
}

const validSections = getSections().reduce( ( acc, section ) => {
Expand Down

0 comments on commit e5b64d2

Please sign in to comment.