mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-06 03:26:59 +03:00
add minUserIDLength config option
This commit is contained in:
3
ci.json
3
ci.json
@@ -76,5 +76,6 @@
|
||||
"clientSecret": "testClientSecret",
|
||||
"redirectUri": "http://127.0.0.1/fake/callback"
|
||||
},
|
||||
"minReputationToSubmitFiller": -1
|
||||
"minReputationToSubmitFiller": -1,
|
||||
"minUserIDLength": 0
|
||||
}
|
||||
|
||||
@@ -66,5 +66,6 @@
|
||||
{
|
||||
"name": "vipUsers"
|
||||
}]
|
||||
}
|
||||
},
|
||||
"minUserIDLength": 30 // minimum length of UserID to be accepted
|
||||
}
|
||||
|
||||
@@ -166,7 +166,8 @@ addDefaults(config, {
|
||||
},
|
||||
gumroad: {
|
||||
productPermalinks: ["sponsorblock"]
|
||||
}
|
||||
},
|
||||
minUserIDLength: 30
|
||||
});
|
||||
loadFromEnv(config);
|
||||
migrate(config);
|
||||
|
||||
@@ -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 };
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,8 @@ export interface SBSConfig {
|
||||
}
|
||||
gumroad: {
|
||||
productPermalinks: string[],
|
||||
}
|
||||
},
|
||||
minUserIDLength: number
|
||||
}
|
||||
|
||||
export interface WebhookConfig {
|
||||
|
||||
Reference in New Issue
Block a user