Skip to content

Commit

Permalink
Fixed how query strings are validated
Browse files Browse the repository at this point in the history
  • Loading branch information
belmirp committed Feb 21, 2023
1 parent a8b3b8e commit 394ea9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions UT4MasterServer.Web/src/pages/ActivateAccount.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion UT4MasterServer.Web/src/pages/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ const route = useRoute();
function parseQueryValues() {
const { activationLinkSent: qActivationLinkSent } = route.query;
if (qActivationLinkSent?.toString() === 'true') {
if (qActivationLinkSent === 'true') {
activationLinkSent.value = true;
}
}
Expand Down

0 comments on commit 394ea9a

Please sign in to comment.