1
0
mirror of https://github.com/barthuijgen/factorio-sites.git synced 2024-11-21 18:16:33 +02:00

Add redirect to factorio.tools

This commit is contained in:
Bart Huijgen 2022-03-12 22:10:39 +01:00
parent 6668ee727e
commit db60aac066

View File

@ -111,6 +111,11 @@ const BlueprintsApp = ({
};
BlueprintsApp.getInitialProps = ({ ctx }: AppContext) => {
if (ctx.req?.headers?.host === "factorioblueprints.tech" && ctx.res) {
ctx.res.statusCode = 302;
ctx.res.setHeader("Location", "https://factorio.tools" + ctx.req?.url);
}
const userToken = getSessionToken(ctx.req);
return { authenticated: !!userToken };
};