fix: Always redirect to custom domain on server if set

This commit is contained in:
Tom Moor
2023-01-02 15:48:06 -05:00
parent 712ff8265e
commit 28a54113e1

View File

@@ -132,6 +132,12 @@ router.get("*", async (ctx, next) => {
})
: undefined;
// Redirect all requests to custom domain if one is set
if (team?.domain && team.domain !== ctx.hostname) {
ctx.redirect(ctx.href.replace(ctx.hostname, team.domain));
return;
}
return renderApp(ctx, next, {
analytics,
});