Redirect to / when setup is done in ssr mode

This commit is contained in:
Zoe Roux 2024-05-26 18:36:34 +02:00
parent a9a74ddc14
commit e015882834
No known key found for this signature in database

View File

@ -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.");
}