From 79e225d1682c2c65050d693391b12bf0a2b0e74a Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Thu, 7 Dec 2023 19:01:52 +0530 Subject: [PATCH] chore: next_path url redirection fix --- space/pages/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/space/pages/index.tsx b/space/pages/index.tsx index e680c257c..4655d1e30 100644 --- a/space/pages/index.tsx +++ b/space/pages/index.tsx @@ -18,8 +18,10 @@ const Index: NextPage = observer(() => { }: RootStore = useMobxStore(); useEffect(() => { - if (next_path && currentUser?.onboarding_step?.profile_complete) - router.push(next_path.toString().replace(/[^a-zA-Z0-9\-._~:/?#[\]@!$&'()*+,;=]/g, "")); + if (next_path && currentUser?.onboarding_step?.profile_complete) { + const encodedPath = encodeURI(next_path.toString()); // Encode the URL + router.push(encodedPath); + } }, [router, next_path, currentUser]); return ;