From 6aa5fa70cf5ccd2825e5657ec1a90e370dea3bcf Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Mon, 16 Oct 2023 11:16:33 +0700
Subject: Fix buy action before and after login

---
 src/lib/auth/components/IsAuth.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/lib/auth/components/IsAuth.jsx')

diff --git a/src/lib/auth/components/IsAuth.jsx b/src/lib/auth/components/IsAuth.jsx
index a32e648c..1948ae0c 100644
--- a/src/lib/auth/components/IsAuth.jsx
+++ b/src/lib/auth/components/IsAuth.jsx
@@ -8,7 +8,7 @@ const IsAuth = ({ children }) => {
 
   useEffect(() => {
     if (!getAuth() && router.pathname != '/login') {
-      router.replace(`/login?next=${router.asPath}`)
+      router.replace(`/login?next=${encodeURIComponent(router.asPath)}`)
     } else {
       setResponse(children)
     }
-- 
cgit v1.2.3

