diff --git a/api/ssrApollo.js b/api/ssrApollo.js
index 2de50596..127a4edd 100644
--- a/api/ssrApollo.js
+++ b/api/ssrApollo.js
@@ -111,7 +111,7 @@ export function getGetServerSideProps (
}
if (error || !data || (notFound && notFound(data, vars, me))) {
- res.writeHead(301, {
+ res.writeHead(302, {
Location: '/404'
}).end()
}
diff --git a/components/invite.js b/components/invite.js
index 445175fb..766a65cd 100644
--- a/components/invite.js
+++ b/components/invite.js
@@ -21,7 +21,7 @@ export default function Invite ({ invite, active }) {
{invite.gift} sat gift
diff --git a/pages/invites/[id].js b/pages/invites/[id].js
index c876988b..e7516249 100644
--- a/pages/invites/[id].js
+++ b/pages/invites/[id].js
@@ -26,9 +26,10 @@ export async function getServerSideProps ({ req, res, query: { id, error = null
})
if (!data?.invite) {
- res.writeHead(301, {
+ res.writeHead(302, {
Location: '/404'
}).end()
+ return { props: {} }
}
if (session && res) {
@@ -43,12 +44,10 @@ export async function getServerSideProps ({ req, res, query: { id, error = null
console.log(e)
}
- return {
- redirect: {
- destination: '/',
- permanent: false
- }
- }
+ res.writeHead(302, {
+ Location: '/'
+ }).end()
+ return { props: {} }
}
return {