add minUserIDLength config option

This commit is contained in:
Michael C 2022-12-17 23:35:13 -05:00
parent cff2325aef
commit 2683c61995
No known key found for this signature in database
GPG key ID: FFB04FB3B878B7B4
5 changed files with 9 additions and 5 deletions

View file

@ -76,5 +76,6 @@
"clientSecret": "testClientSecret",
"redirectUri": "http://127.0.0.1/fake/callback"
},
"minReputationToSubmitFiller": -1
"minReputationToSubmitFiller": -1,
"minUserIDLength": 0
}

View file

@ -66,5 +66,6 @@
{
"name": "vipUsers"
}]
}
},
"minUserIDLength": 30 // minimum length of UserID to be accepted
}

View file

@ -166,7 +166,8 @@ addDefaults(config, {
},
gumroad: {
productPermalinks: ["sponsorblock"]
}
},
minUserIDLength: 30
});
loadFromEnv(config);
migrate(config);

View file

@ -325,7 +325,7 @@ export async function vote(ip: IPAddress, UUID: SegmentUUID, paramUserID: UserID
return { status: 400 };
}
// Ignore this vote, invalid
if (paramUserID.length < 30 && config.mode !== "test") {
if (paramUserID.length < config.minUserIDLength) {
return { status: 200 };
}

View file

@ -94,7 +94,8 @@ export interface SBSConfig {
}
gumroad: {
productPermalinks: string[],
}
},
minUserIDLength: number
}
export interface WebhookConfig {