fixed trackme not working correctly

This commit is contained in:
cnachtigall1991
2021-10-13 18:37:37 +02:00
parent 66c18ffe02
commit 38289b4091
2 changed files with 14 additions and 14 deletions

View File

@@ -17,12 +17,12 @@ export const TrackMe = async (id64, authcode, sharecode) => {
const shareCodeRegex = /^CSGO(?:-?[ABCDEFGHJKLMNOPQRSTUVWXYZabcdefhijkmnopqrstuvwxyz23456789]{5}){5}$/
const authCodeRegex = /^[ABCDEFGHJKLMNOPQRSTUVWXYZ23456789]{4}-[ABCDEFGHJKLMNOPQRSTUVWXYZ23456789]{5}-[ABCDEFGHJKLMNOPQRSTUVWXYZ23456789]{4}$/
if (!shareCodeRegex.test(sharecode)) {
if (sharecode && !shareCodeRegex.test(sharecode)) {
statusError = 'Is not a valid sharecode'
status = 418
return [status, statusError]
}
if (!authCodeRegex.test(authcode)) {
if (authcode === '' || !authCodeRegex.test(authcode)) {
statusError = 'Is not a valid authcode'
status = 418
return [status, statusError]