diff --git a/client/boot/common.js b/client/boot/common.js index 6966833534b4e..3e08797a551a7 100644 --- a/client/boot/common.js +++ b/client/boot/common.js @@ -108,6 +108,10 @@ const loggedOutMiddleware = currentUser => { page( '*', ( context, next ) => { if ( isValidSection( context.path ) ) { + // redirect to login page if we're not on it already, only for stats for now + if ( startsWith( context.path, '/stats' ) ) { + return page.redirect( '/log-in/?redirect_to=' + encodeURIComponent( context.path ) ); + } next(); } } ); diff --git a/client/wordpress-com.js b/client/wordpress-com.js index 7038dc7297071..3946e945e57ed 100644 --- a/client/wordpress-com.js +++ b/client/wordpress-com.js @@ -188,6 +188,7 @@ const sections = [ module: 'my-sites/stats', secondary: true, group: 'sites', + enableLoggedOut: true, }, { name: 'checklist',