diff --git a/client/controller/index.web.js b/client/controller/index.web.js index 2933338444516e..b422d1db5b7762 100644 --- a/client/controller/index.web.js +++ b/client/controller/index.web.js @@ -134,6 +134,11 @@ export const redirectInvalidLanguage = ( context, next ) => { export function redirectLoggedOut( context, next ) { const state = context.store.getState(); + // Allow logged-out users to access account deleted page for self-restore. + // This is an exception because /me should not allow enableLoggedOut. + if ( context.pathname === '/me/account/closed' ) { + return next(); + } if ( isUserLoggedIn( state ) ) { next(); diff --git a/client/sections.js b/client/sections.js index 99a3a185d2a44a..22181a6c6438e9 100644 --- a/client/sections.js +++ b/client/sections.js @@ -39,6 +39,9 @@ const sections = [ }, { name: 'account-close', + // /me/account/closed enables account restoration for logged-out users + // Parent route is private so enableLoggedOut flag won't work here + // Redirection is handled in redirectLoggedOut paths: [ '/me/account/close', '/me/account/closed' ], module: 'calypso/me/account-close', group: 'me',