move hompage redirect to end

This commit is contained in:
Sean Yesmunt 2020-01-08 19:26:36 -05:00
parent 4ccefa0252
commit bfc581cbda

View file

@ -19,11 +19,6 @@ async function redirectMiddleware(ctx, next) {
return;
}
if (path === '/') {
ctx.redirect(`/$/${PAGES.CHANNELS_FOLLOWING}`);
return;
}
if (!path.startsWith('/$/') && path.match(/^([^@/:]+)\/([^:/]+)$/)) {
ctx.redirect(url.replace(/^([^@/:]+)\/([^:/]+)(:(\/.*))/, '$1:$2')); // test against path, but use ctx.url to retain parameters
return;
@ -43,6 +38,11 @@ async function redirectMiddleware(ctx, next) {
return;
}
if (path === '/') {
ctx.redirect(`/$/${PAGES.CHANNELS_FOLLOWING}`);
return;
}
// No redirects needed
await next();
}