From 2560b72596d49751234fb15e507bbde52e37f673 Mon Sep 17 00:00:00 2001 From: GitStart <1501599+gitstart@users.noreply.github.com> Date: Mon, 23 May 2022 11:34:11 +0100 Subject: [PATCH] Wrong username is identified if query params are present and user doesn't exist (#2838) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: gitstart Co-authored-by: JĂșlio Piubello da Silva Cabral --- apps/web/pages/404.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/pages/404.tsx b/apps/web/pages/404.tsx index 90a54f04fa..4503e3eae8 100644 --- a/apps/web/pages/404.tsx +++ b/apps/web/pages/404.tsx @@ -15,7 +15,7 @@ export default function Custom404() { const { t } = useLocale(); const router = useRouter(); - const username = router.asPath.replace("%20", "-"); + const username = router.asPath.replace("%20", "-").split(/[?#]/)[0]; const links = [ {