diff --git a/src/middleware.ts b/src/middleware.ts index fffd32324..fe1b18311 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -1,6 +1,7 @@ import { NextRequest, NextResponse } from 'next/server'; import { env } from 'process'; +import { getUrl } from './tools/server/url'; import { client } from './utils/api'; const skippedUrls = [ @@ -41,7 +42,5 @@ export async function middleware(req: NextRequest) { return NextResponse.next(); } - url.pathname = '/onboard'; - - return NextResponse.redirect(url); + return NextResponse.redirect(getUrl(req) + '/onboard'); } diff --git a/src/pages/404.tsx b/src/pages/404.tsx index e0afe4192..d703aad43 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -1,9 +1,9 @@ import { Button, Center, Stack, Text, Title, createStyles } from '@mantine/core'; import { GetServerSidePropsContext } from 'next'; +import { useTranslation } from 'next-i18next'; import Head from 'next/head'; import Image from 'next/image'; import Link from 'next/link'; -import { useTranslation } from 'next-i18next'; import pageNotFoundImage from '~/images/undraw_page_not_found_re_e9o6.svg'; import { pageNotFoundNamespaces } from '~/tools/server/translation-namespaces'; @@ -24,7 +24,7 @@ export default function Custom404() {