Skip to content

Commit c7db37e

Browse files
committed
fix(web): trying to serverside redirect in client side
1 parent 26f6f57 commit c7db37e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

apps/web/pages/_app.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,17 @@ MyApp.getInitialProps = async ({ ctx: { query, res } }) => {
6161

6262
if (!host) {
6363
const currentShop = shop ?? process.env.SHOP;
64-
res.writeHead(307, { Location: `/api/online/auth?shop=${currentShop}` });
65-
res.end();
6664

67-
return { pageProps: {} };
65+
if (res) {
66+
res.writeHead(307, { Location: `/api/online/auth?shop=${currentShop}` });
67+
res.end();
68+
69+
return { pageProps: {} };
70+
}
71+
72+
return {
73+
pageProps: {},
74+
};
6875
}
6976

7077
return {

0 commit comments

Comments
 (0)