From 524783bcdcd82d6cc36758e88a96e7ddbd103b4e Mon Sep 17 00:00:00 2001
From: Leonardo <leomilho@gmail.com>
Date: Mon, 2 Dec 2024 18:46:37 +0100
Subject: [PATCH] fix(logout): properly encode next url

---
 apps/web/src/components/navbar/navbar.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/apps/web/src/components/navbar/navbar.tsx b/apps/web/src/components/navbar/navbar.tsx
index 1ef0aa20e..aead53e59 100644
--- a/apps/web/src/components/navbar/navbar.tsx
+++ b/apps/web/src/components/navbar/navbar.tsx
@@ -105,8 +105,8 @@ export const Navbar = () => {
                   <DropdownItem
                     value="Log out"
                     onClick={() => {
-                      const current = new URL(window.location.href);
-                      location.replace(`${getEnvVariable('GP_AUTH_URL')}if/flow/default-invalidation-flow/?next=${current.toString()}`);
+                      const current = encodeURIComponent(window.location.href);
+                      location.replace(`${getEnvVariable('GP_AUTH_URL')}if/flow/default-invalidation-flow/?next=${current}`);
                     }}
                   />
                   {authCache.authorization?.demoUser?.R && (
-- 
GitLab