From e015882834e36277d4311832235de110a2752262 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sun, 26 May 2024 18:36:34 +0200 Subject: [PATCH] Redirect to / when setup is done in ssr mode --- front/apps/web/src/pages/_app.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/front/apps/web/src/pages/_app.tsx b/front/apps/web/src/pages/_app.tsx index 9bf3e833..4f2d07b1 100755 --- a/front/apps/web/src/pages/_app.tsx +++ b/front/apps/web/src/pages/_app.tsx @@ -266,6 +266,11 @@ App.getInitialProps = async (ctx: AppContext) => { ctx.ctx.res!.end(); return {} as any; } + if (info!.setupStatus === SetupStep.Done && ctx.router.route === "/setup") { + ctx.ctx.res!.writeHead(307, { Location: "/" }); + ctx.ctx.res!.end(); + return {} as any; + } } catch (e) { console.error("SSR error, disabling it."); }