From 418bddd3222f3e15702dcfb7c2d731eab4adbe3c Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Wed, 30 Aug 2023 18:01:21 -0300 Subject: [PATCH] fix(formModal): encode the accessToken parameter in the chatEndpoint URL to handle special characters correctly The accessToken parameter in the chatEndpoint URL is now encoded using the encodeURIComponent function to handle special characters correctly. This ensures that the accessToken is properly passed to the chat endpoint without causing any issues. --- src/frontend/src/modals/formModal/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/modals/formModal/index.tsx b/src/frontend/src/modals/formModal/index.tsx index 01d6a0954..041132d0d 100644 --- a/src/frontend/src/modals/formModal/index.tsx +++ b/src/frontend/src/modals/formModal/index.tsx @@ -175,7 +175,7 @@ export default function FormModal({ return `${ isDevelopment ? "ws" : webSocketProtocol - }://${host}${chatEndpoint}?token=${accessToken}`; + }://${host}${chatEndpoint}?token=${encodeURIComponent(accessToken!)}`; } function handleWsMessage(data: any) {