From 394ea9a190d3a5509b148bf2232a458d8baa2ee0 Mon Sep 17 00:00:00 2001 From: Belmir Patkovic Date: Tue, 21 Feb 2023 18:26:27 +0100 Subject: [PATCH] Fixed how query strings are validated --- UT4MasterServer.Web/src/pages/ActivateAccount.vue | 8 ++++---- UT4MasterServer.Web/src/pages/Login.vue | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/UT4MasterServer.Web/src/pages/ActivateAccount.vue b/UT4MasterServer.Web/src/pages/ActivateAccount.vue index 3ddf5f10..44b9d73a 100644 --- a/UT4MasterServer.Web/src/pages/ActivateAccount.vue +++ b/UT4MasterServer.Web/src/pages/ActivateAccount.vue @@ -30,16 +30,16 @@ const accountService = new AccountService(); async function activateAccount() { try { status.value = AsyncStatus.BUSY; - const { accountId, guid } = route.query; + const { accountId: qAccountId, guid: qGuid } = route.query; - if (accountId?.toString() === '' || guid?.toString() === '') { + if (!qAccountId?.length || !qGuid?.length) { status.value = AsyncStatus.ERROR; return; } const formData = { - accountId: accountId as string, - guid: guid as string + accountId: qAccountId as string, + guid: qGuid as string }; await accountService.activateAccount(formData); diff --git a/UT4MasterServer.Web/src/pages/Login.vue b/UT4MasterServer.Web/src/pages/Login.vue index d6210891..f2c42137 100644 --- a/UT4MasterServer.Web/src/pages/Login.vue +++ b/UT4MasterServer.Web/src/pages/Login.vue @@ -123,7 +123,8 @@ const route = useRoute(); function parseQueryValues() { const { activationLinkSent: qActivationLinkSent } = route.query; - if (qActivationLinkSent?.toString() === 'true') { + + if (qActivationLinkSent === 'true') { activationLinkSent.value = true; } }